]> www.infradead.org Git - users/jedix/linux-maple.git/commit
posix-timers: Invoke cond_resched() during exit_itimers()
authorBenjamin Segall <bsegall@google.com>
Fri, 14 Feb 2025 22:12:20 +0000 (14:12 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:12:49 +0000 (10:12 +0100)
commitf99c5bb396b8d1424ed229d1ffa6f596e3b9c36b
tree0828a646a83c6bda57b3a35f0d96283051ff0224
parent4441b976dfeff0d3579e8da3c0283300c618a553
posix-timers: Invoke cond_resched() during exit_itimers()

exit_itimers() loops through every timer in the process to delete it.  This
requires taking the system-wide hash_lock for each of these timers, and
contends with other processes trying to create or delete timers.

When a process creates hundreds of thousands of timers, and then exits
while other processes contend with it, this can trigger softlockups on
CONFIG_PREEMPT=n.

Add a cond_resched() invocation into the loop to allow the system to make
progress.

Signed-off-by: Ben Segall <bsegall@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/xm2634gg2n23.fsf@google.com
kernel/time/posix-timers.c