[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tebnrmbl6ouz567vlalojcynk25siwwom7et7yn2vvi6zyv6nv@jj3r5o3kl52j>
Date: Tue, 11 Jul 2023 13:52:50 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: Waiman Long <longman@...hat.com>, tj@...nel.org,
hannes@...xchg.org, lizefan.x@...edance.com,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cgroup/cpuset: update parent subparts cpumask while
holding css refcnt
On Tue, Jul 11, 2023 at 10:52:02AM +0800, Miaohe Lin <linmiaohe@...wei.com> wrote:
> commit 2bdfd2825c9662463371e6691b1a794e97fa36b4
> Author: Waiman Long <longman@...hat.com>
> Date: Wed Feb 2 22:31:03 2022 -0500
>
> cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning
Aha, thanks for the pointer.
I've also found a paragraph in [1]:
> In addition, the -rt patchset turns spinlocks into a sleeping locks so
> that the corresponding critical sections can be preempted, which also
> means that these sleeplockified spinlocks (but not other sleeping
> locks!) may be acquire within -rt-Linux-kernel RCU read-side critical
> sections.
That suggests (together with practical use) that dicussed spinlocks
should be fine in RCU read section. And the possible reason is deeper in
generate_sched_domains() that do kmalloc(..., GFP_KERNEL).
Alas update_cpumask_hier() still calls generate_sched_domains(), OTOH,
update_parent_subparts_cpumask() doesn't seem so.
The idea to not relieve rcu_read_lock() in update_cpumask() iteration
(instead of the technically unneeded refcnt bump) would have to be
verified with CONFIG_PROVE_RCU && CONFIG_LOCKDEP. WDYT?
Michal
[1] https://www.kernel.org/doc/html/latest/RCU/Design/Requirements/Requirements.html?highlight=rcu+read+section#specialization
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists