From: Thomas Gleixner <tglx@linutronix.de>
To: Benjamin Segall <bsegall@google.com>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
linux-kernel@vger.kernel.org
Cc: Eric Dumazet <edumazet@google.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] posix-timers: cond_resched() during exit_itimers()
Date: Tue, 18 Feb 2025 10:03:47 +0100 [thread overview]
Message-ID: <877c5nk4jw.ffs@tglx> (raw)
In-Reply-To: <xm2634gg2n23.fsf@google.com>
On Fri, Feb 14 2025 at 14:12, Benjamin Segall wrote:
> exit_itimers() loops through every timer in the process to delete it.
> This requires taking the system-wide hash_lock for each of these locks,
> 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.
>
> Ideally this will some day be better solved by eliminating the global
> hashtable, but until that point mitigate the issue by doing
> cond_resched in that loop.
It won't help for a PREEMPT_NONE kernel because the loop will be equally
long as before. Only the hash lock contention will be smaller, but that
does not mean that mopping up 100k timers won't be able to take ages.
We really need to get this PREEMPT_LAZY thing going and kill all of this
cond_resched() nonsense.
Thanks,
tglx
next prev parent reply other threads:[~2025-02-18 9:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 22:12 [PATCH] posix-timers: cond_resched() during exit_itimers() Benjamin Segall
2025-02-18 9:03 ` Thomas Gleixner [this message]
2025-02-18 22:34 ` Benjamin Segall
2025-02-18 9:25 ` [tip: timers/core] posix-timers: Invoke " tip-bot2 for Benjamin Segall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877c5nk4jw.ffs@tglx \
--to=tglx@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=bsegall@google.com \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.