[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112085124.O5dlZ8Og@linutronix.de>
Date: Wed, 12 Nov 2025 09:51:24 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Waiman Long <longman@...hat.com>
Cc: Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
Chen Ridong <chenridong@...wei.com>, Pingfan Liu <piliu@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>
Subject: Re: [cgroup/for-6.19 PATCH] cgroup/cpuset: Make callback_lock a
raw_spinlock_t
On 2025-11-11 22:57:59 [-0500], Waiman Long wrote:
> The callback_lock is a spinlock_t which is acquired either to read
> a stable set of cpu or node masks or to modify those masks when
> cpuset_mutex is also acquired. Sometime it may need to go up the
> cgroup hierarchy while holding the lock to find the right set of masks
> to use. Assuming that the depth of the cgroup hierarch is finite and
> typically small, the lock hold time should be limited.
We can't assume that, can we?
> Some externally callable cpuset APIs like cpuset_cpus_allowed() and
cpuset_cpus_allowed() has three callers in kernel/sched/ and all use
GFP_KERNEL shortly before invoking the function in question.
> cpuset_mems_allowed() acquires callback_lock with irq disabled to ensure
This I did not find. But I would ask to rework it somehow that we don't
need to use raw_spinlock_t as a hammer that solves it all.
> stable cpuset data. These APIs currently have the restriction that they
> can't be called when a raw spinlock is being held. This is needed to
> work correctly in a PREEMPT_RT kernel. This requires additional code
> changes to work around this limitation. See [1] for a discussion of that.
>
> Make these external cpuset APIs more useful by changing callback_lock
> to a raw_spinlock_t to remove this limitation so that they can be called
> from within other raw spinlock critical sections if needed.
>
> [1] https://lore.kernel.org/lkml/20251110014706.8118-1-piliu@redhat.com/
>
> Signed-off-by: Waiman Long <longman@...hat.com>
Sebastian
Powered by blists - more mailing lists