Skip to contentSkip to conversation

6.8-rc process is unable to exit and consumes a lot of cpu

REGRESSION Paul Holzinger 4 participants 10 messages Feb 21, 2024 – Feb 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

Reproducing the problem outside of our CI systems seem to be very difficult, it took me a week until I finally reproduced the problem on a system where I have ssh access. I currently reproduced it on 6.8-rc3 but we also confirmed that this issue still exists in rc5 On my system the problematic pid is 661803

# ps -o pid,state,pcpu,comm, -p 661803
    PID S %CPU COMMAND
 661803 R 98.8 sh

I was able to read the stack once in proc:

# cat /proc/661803/stack
[<0>] shrink_dcache_parent+0x64/0x140
[<0>] shrink_dcache_for_umount+0x3b/0x130
[<0>] generic_shutdown_super+0x1e/0x110
[<0>] kill_litter_super+0x27/0x50
[<0>] deactivate_locked_super+0x30/0xb0
[<0>] cleanup_mnt+0xba/0x150
[<0>] task_work_run+0x5a/0x90
[<0>] do_exit+0x35e/0xaf0
[<0>] do_group_exit+0x31/0x80
[<0>] __x64_sys_exit_group+0x18/0x20
[<0>] do_syscall_64+0x86/0x170
[<0>] entry_SYSCALL_64_after_hwframe+0x6e/0x76

However if I try the same again now I do not get any output from it. Also the whole /proc/$pid directory is in a weird state, it seems a lot of the process resources are already cleaned up and inaccessible.

Given the process consumes so much cpu I assume it runs in some infinity loop inside the kernel process exit path. I also tried to attach strace and gdb to the process but that just hanged and did nothing.

I still have the system up and running in case more data is needed please let me know. Also any advice on how I could debug this further would be appreciated. I can try to to compile the kernel and use git bisect but given it took me a week to reproduce the first time it will not yield any useful result soon.

Note we see this in the Podman tests[1] and because Podman is a container manager we make heavy use of namespaces, cgroups and seccomp in case it matters.

[1] https://github.com/containers/podman/issues/21504

#regzbot introduced v6.7..v6.8-rc1

Thanks
Paul Holzinger

#1 lore raw
Quoted 37 lines · Paul Holzinger

Hi all,

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

Reproducing the problem outside of our CI systems seem to be very difficult, it took me a week until I finally reproduced the problem on a system where I have ssh access. I currently reproduced it on 6.8-rc3 but we also confirmed that this issue still exists in rc5 On my system the problematic pid is 661803

# ps -o pid,state,pcpu,comm, -p 661803
    PID S %CPU COMMAND
 661803 R 98.8 sh

I was able to read the stack once in proc:

# cat /proc/661803/stack
[<0>] shrink_dcache_parent+0x64/0x140
[<0>] shrink_dcache_for_umount+0x3b/0x130
[<0>] generic_shutdown_super+0x1e/0x110
[<0>] kill_litter_super+0x27/0x50
[<0>] deactivate_locked_super+0x30/0xb0
[<0>] cleanup_mnt+0xba/0x150
[<0>] task_work_run+0x5a/0x90
[<0>] do_exit+0x35e/0xaf0
[<0>] do_group_exit+0x31/0x80
[<0>] __x64_sys_exit_group+0x18/0x20
[<0>] do_syscall_64+0x86/0x170
[<0>] entry_SYSCALL_64_after_hwframe+0x6e/0x76

However if I try the same again now I do not get any output from it. Also the whole /proc/$pid directory is in a weird state, it seems a lot of the process resources are already cleaned up and inaccessible.

Given the process consumes so much cpu I assume it runs in some infinity loop inside the kernel process exit path. I also tried to attach strace and gdb to the process but that just hanged and did nothing.

I still have the system up and running in case more data is needed please let me know. Also any advice on how I could debug this further would be appreciated. I can try to to compile the kernel and use git bisect but given it took me a week to reproduce the first time it will not yield any useful result soon.

Note we see this in the Podman tests[1] and because Podman is a container manager we make heavy use of namespaces, cgroups and seccomp in case it matters.

Quoted 8 lines

[1] https://github.com/containers/podman/issues/21504

#regzbot introduced v6.7..v6.8-rc1

Thanks
Paul Holzinger

Also to add on some CI systems we see "kernel: WARNING: stack going in the wrong direction? at do_syscall_64+0x89/0x170" in the logs but not all of them. I do not have this warning on the system where I reproduced it. Other than this there is no kernel oops or anything like it in the logs.

#2 lore raw
Quoted 7 lines · Paul Holzinger
Quoted 5 lines · Paul Holzinger

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

[...]

Thx for the report.

Warning, this is not my area of expertise, so this might send you in the totally wrong direction.

I briefly checked lore for similar reports and noticed this one when I searched for shrink_dcache_parent:

https://lore.kernel.org/all/[email protected]/

Do you think that might be related? A fix for this is pending in vfs.git.

Ciao, Thorsten

#3 lore raw

Hi Thorsten,

Quoted 12 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 6 lines · Paul Holzinger
Quoted 4 lines · Paul Holzinger

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

[...]

Thx for the report.

Warning, this is not my area of expertise, so this might send you in the totally wrong direction.

Quoted 9 lines

I briefly checked lore for similar reports and noticed this one when I searched for shrink_dcache_parent:

https://lore.kernel.org/all/[email protected]/

Do you think that might be related? A fix for this is pending in vfs.git.

Ciao, Thorsten

yes that does seem very relevant. Running the sysrq command I get the same backtrace as the reporter there so I think it is fair to assume this is the same bug. Looking forward to get the fix into mainline.

Thanks,
Paul

#4 lore raw

[adding Al, Christian and a few lists to the list of recipients to ensure all affected parties are aware of this new report about a bug for which a fix is committed, but not yet mainlined]

Thread starts here:
https://lore.kernel.org/all/[email protected]/

Quoted 18 lines · Paul Holzinger

Hi Thorsten,

Quoted 15 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 6 lines · Paul Holzinger
Quoted 4 lines · Paul Holzinger

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

[...]

Thx for the report.

Warning, this is not my area of expertise, so this might send you in the totally wrong direction.

I briefly checked lore for similar reports and noticed this one when I searched for shrink_dcache_parent:

Quoted 7 lines
Quoted 4 lines

https://lore.kernel.org/all/[email protected]/

Do you think that might be related? A fix for this is pending in vfs.git.

yes that does seem very relevant. Running the sysrq command I get the same backtrace as the reporter there so I think it is fair to assume this is the same bug. Looking forward to get the fix into mainline.

FWIW, "the fix" afaics is 7e4a205fe56b90 ("Revert "get rid of DCACHE_GENOCIDE"") sitting 'fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for more than a week now.

I assume Al or Christian will send this to Linus soon. Christian in fact already mentioned that he plans to send another vfs fix to Linux, but that one iirc was sitting in another repo (but I might be mistaken there!).

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

P.S.: let me update regzbot while at it:

#regzbot introduced 57851607326a2beef21e67f83f4f53a90df8445a. #regzbot fix: Revert "get rid of DCACHE_GENOCIDE"

#5 lore raw
Quoted 6 lines · Linux regression tracking (Thorsten Leemhuis)

[adding Al, Christian and a few lists to the list of recipients to ensure all affected parties are aware of this new report about a bug for which a fix is committed, but not yet mainlined]

Thread starts here:
https://lore.kernel.org/all/[email protected]/

[adding Linus now as well]

TWIMC, the quoted mail apparently did not get delivered to Al (I got a "48 hours on the queue" warning from my hoster's MTA ~10 hours ago).

Ohh, and there is some suspicion that the problem Calvin[1] and Paul (this thread, see quote below for the gist) encountered also causes problems for bwrap (used by Flapak)[2].
[1] https://lore.kernel.org/all/[email protected]/
[2] https://github.com/containers/bubblewrap/issues/620

Christian, Linus, all that makes me wonder if it might be wise to pick up the revert[1] Al queued directly in case Al does not submit a PR today or tomorrow for -rc6.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=fixes&id=7e4a205fe56b9092f0143dad6aa5fee081139b09

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

#regzbot poke

Quoted 46 lines · Paul Holzinger
Quoted 18 lines

Hi Thorsten,

Quoted 15 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 6 lines · Paul Holzinger
Quoted 4 lines · Paul Holzinger

we are seeing problems with the 6.8-rc kernels[1] in our CI systems, we see random process timeouts across our test suite. It appears that sometimes a process is unable to exit, nothing happens even if we send SIGKILL and instead the process consumes a lof of cpu.

[...]

Thx for the report.

Warning, this is not my area of expertise, so this might send you in the totally wrong direction.

I briefly checked lore for similar reports and noticed this one when I searched for shrink_dcache_parent:

Quoted 7 lines
Quoted 4 lines

https://lore.kernel.org/all/[email protected]/

Do you think that might be related? A fix for this is pending in vfs.git.

yes that does seem very relevant. Running the sysrq command I get the same backtrace as the reporter there so I think it is fair to assume this is the same bug. Looking forward to get the fix into mainline.

FWIW, "the fix" afaics is 7e4a205fe56b90 ("Revert "get rid of DCACHE_GENOCIDE"") sitting 'fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for more than a week now.

I assume Al or Christian will send this to Linus soon. Christian in fact already mentioned that he plans to send another vfs fix to Linux, but that one iirc was sitting in another repo (but I might be mistaken there!).

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

P.S.: let me update regzbot while at it:

#regzbot introduced 57851607326a2beef21e67f83f4f53a90df8445a. #regzbot fix: Revert "get rid of DCACHE_GENOCIDE"

#6 lore raw
Quoted 3 lines · Thorsten Leemhuis

TWIMC, the quoted mail apparently did not get delivered to Al (I got a "48 hours on the queue" warning from my hoster's MTA ~10 hours ago).

Al's email has been broken for the last almost two weeks - the machine went belly-up in a major way.

I bounced the email to his kernel.org email that seems to work, but I also think Al ends up being busy trying to get through everything else he missed, in addition to trying to get the machine working again...

Linus

#7 lore raw
Quoted 6 lines · Linus Torvalds
Quoted 3 lines · Thorsten Leemhuis

TWIMC, the quoted mail apparently did not get delivered to Al (I got a "48 hours on the queue" warning from my hoster's MTA ~10 hours ago).

Quoted 6 lines

Al's email has been broken for the last almost two weeks - the machine went belly-up in a major way.

I bounced the email to his kernel.org email that seems to work, but I also think Al ends up being busy trying to get through everything else he missed, in addition to trying to get the machine working again...

FWIW, I'm pretty sure that it's fixed by #fixes^ (7e4a205fe56b) in my tree; I'll send a pull request, both for #fixes and #fixes.pathwalk.rcu

#8 lore raw
Quoted 11 lines · Al Viro
Quoted 10 lines · Linus Torvalds
Quoted 3 lines · Thorsten Leemhuis

TWIMC, the quoted mail apparently did not get delivered to Al (I got a "48 hours on the queue" warning from my hoster's MTA ~10 hours ago).

Al's email has been broken for the last almost two weeks - the machine went belly-up in a major way.

I bounced the email to his kernel.org email that seems to work,

Thx!

Quoted 6 lines
Quoted 3 lines

but I
also think Al ends up being busy trying to get through everything else he missed, in addition to trying to get the machine working again...

FWIW, I'm pretty sure that it's fixed by #fixes^ (7e4a205fe56b) in my tree; I'll send a pull request, both for #fixes and #fixes.pathwalk.rcu

Great, thank you, too!

Ciao, Thorsten

#9 lore raw
In reply to Thorsten Leemhuis
Quoted 19 lines · Thorsten Leemhuis
Quoted 6 lines · Linux regression tracking (Thorsten Leemhuis)

[adding Al, Christian and a few lists to the list of recipients to ensure all affected parties are aware of this new report about a bug for which a fix is committed, but not yet mainlined]

Thread starts here:
https://lore.kernel.org/all/[email protected]/

[adding Linus now as well]

TWIMC, the quoted mail apparently did not get delivered to Al (I got a "48 hours on the queue" warning from my hoster's MTA ~10 hours ago).

Ohh, and there is some suspicion that the problem Calvin[1] and Paul (this thread, see quote below for the gist) encountered also causes problems for bwrap (used by Flapak)[2].
[1] https://lore.kernel.org/all/[email protected]/
[2] https://github.com/containers/bubblewrap/issues/620

Quoted 3 lines

Christian, Linus, all that makes me wonder if it might be wise to pick up the revert[1] Al queued directly in case Al does not submit a PR today or tomorrow for -rc6.

See #fixes in my tree.