Bug 216054

Summary: proc: Fix a dentry lock race between release_task and lookup
Product: File System Reporter: Zhihao Cheng (chengzhihao1)
Component: OtherAssignee: fs_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.18-rc7 Subsystem:
Regression: No Bisected commit-id:
Attachments: a.c
access.sh
run.sh

Description Zhihao Cheng 2022-05-31 07:32:10 UTC
Process systemd can take long period high cpu usage during releasing task, which can be reproduced by following steps:
1. gcc -o aa a.c
2. ./run.sh # Termial 1
3. ./access.sh # Termial 2, after run.sh finish
4. time killall -wq aa


$ top # during killall

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                 
    1 root      20   0   73152   8144   6348 S  99.7  0.0   0:22.56 systemd                                                                 
 5117 root      20   0  145096   1688   1448 R  99.7  0.0   0:04.86 ps
Comment 1 Zhihao Cheng 2022-05-31 07:36:42 UTC
(In reply to Zhihao Cheng from comment #0)
> Process systemd can take long period high cpu usage during releasing task,
> which can be reproduced by following steps:
> 1. gcc -o aa a.c
> 2. ./run.sh # Termial 1
> 3. ./access.sh # Termial 2, after run.sh finish
> 4. time killall -wq aa
> 
real	4m40.946s
user	0m0.010s
sys	0m0.052s
> 
> $ top # during killall
> 
>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND 
> 
>     1 root      20   0   73152   8144   6348 S  99.7  0.0   0:22.56 systemd 
> 
>  5117 root      20   0  145096   1688   1448 R  99.7  0.0   0:04.86 ps
Comment 2 Zhihao Cheng 2022-05-31 07:42:30 UTC
Created attachment 301081 [details]
a.c
Comment 3 Zhihao Cheng 2022-05-31 07:42:43 UTC
Created attachment 301082 [details]
access.sh
Comment 4 Zhihao Cheng 2022-05-31 07:42:57 UTC
Created attachment 301083 [details]
run.sh