From: "Paul E. McKenney" <paulmck@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: rostedt@goodmis.org, pjaroszynski@nvidia.com,
Andrew Morton <akpm@linux-foundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
puranjay@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
kernel-team@meta.com, dcostantino@meta.com
Subject: Re: [PATCH] mm/kmemleak: report RCU-tasks quiescent states during the scan
Date: Fri, 31 Jul 2026 11:19:02 -0700 [thread overview]
Message-ID: <23a60deb-c73a-47da-bd5b-4bf3c1c1bc8a@paulmck-laptop> (raw)
In-Reply-To: <amzjjjZrseO-jMJL@gmail.com>
On Fri, Jul 31, 2026 at 11:07:44AM -0700, Breno Leitao wrote:
> On Thu, Jul 30, 2026 at 07:57:22AM -0700, Paul E. McKenney wrote:
> > > I suppose we want two things:
> > >
> > > 1) change cond_resched() with cond_resched_tasks_rcu_qs()
> > > 2) Avoiding holding the ftrace lock while calling
> > > synchronize_rcu_tasks()? It can take up to 10 minutes on a healthy
> > > system to be releasd, right?
> >
> > I do very much like both of those options. ;-)
> >
> > If #2 is impossible, would it make sense to have a mutex_lock_idle() or
> > similar in order to sanctify the lock synchronize_rcu_tasks() latencies?
>
> How would mutex_lock_idle() differ from a regular mutex_lock() when
> sanctifying synchronize_rcu_tasks() latencies?
It would sleep at TASK_IDLE instead of TASK_UNINTERRUPTIBLE, as shown
below. This would cause it to be ignored for hung-task purposes.
For a similar example, RCU uses swait_event_idle_exclusive() instead
of swait_event_exclusive() to avoid its grace-period kthread getting a
hung-task warning when the system doesn't need a grace period for more
than two minutes.
Yes, I did learn about this the hard way. Why do you ask? ;-)
The downside is that if some bug somewhere else under one of these mutexes
caused a too-long sleep, that too-long sleep would be silently ignored.
As always, choose wisely!
Thanx, Paul
------------------------------------------------------------------------
static noinline void __sched
__mutex_lock_slowpath_idle(struct mutex *lock)
__acquires(lock)
{
__mutex_lock(lock, TASK_IDLE, 0, NULL, _RET_IP_);
__acquire(lock);
}
next prev parent reply other threads:[~2026-07-31 18:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 13:23 Breno Leitao
2026-07-20 15:25 ` Paul E. McKenney
2026-07-20 22:39 ` Andrew Morton
2026-07-21 4:21 ` Paul E. McKenney
2026-07-23 13:26 ` Breno Leitao
2026-07-23 15:56 ` Paul E. McKenney
2026-07-24 9:58 ` Breno Leitao
2026-07-24 17:29 ` Paul E. McKenney
2026-07-27 13:04 ` Breno Leitao
2026-07-27 16:02 ` Breno Leitao
2026-07-30 14:06 ` Breno Leitao
2026-07-30 14:57 ` Paul E. McKenney
2026-07-31 18:07 ` Breno Leitao
2026-07-31 18:19 ` Paul E. McKenney [this message]
2026-08-10 10:00 ` Breno Leitao
2026-07-21 0:00 ` SJ Park
2026-08-12 8:39 ` Catalin Marinas
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=23a60deb-c73a-47da-bd5b-4bf3c1c1bc8a@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dcostantino@meta.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pjaroszynski@nvidia.com \
--cc=puranjay@kernel.org \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®