[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJD7tka2op5wfRKawumoGrScVRA3qD0c2N-WshcmMbPzFBe0wQ@mail.gmail.com>
Date: Thu, 7 Dec 2023 09:52:54 -0800
From: Yosry Ahmed <yosryahmed@...gle.com>
To: Waiman Long <longman@...hat.com>
Cc: Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Yafang Shao <laoar.shao@...il.com>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH-cgroup v2] cgroup: Move rcu_head up near the top of cgroup_root
On Thu, Dec 7, 2023 at 5:46 AM Waiman Long <longman@...hat.com> wrote:
>
> Commit d23b5c577715 ("cgroup: Make operations on the cgroup root_list RCU
> safe") adds a new rcu_head to the cgroup_root structure and kvfree_rcu()
> for freeing the cgroup_root.
>
> The current implementation of kvfree_rcu(), however, has the limitation
> that the offset of the rcu_head structure within the larger data
> structure must be less than 4096 or the compilation will fail. See the
> macro definition of __is_kvfree_rcu_offset() in include/linux/rcupdate.h
> for more information.
>
> By putting rcu_head below the large cgroup structure, any change to the
> cgroup structure that makes it larger run the risk of causing build
> failure under certain configurations. Commit 77070eeb8821 ("cgroup:
> Avoid false cacheline sharing of read mostly rstat_cpu") happens to be
> the last straw that breaks it. Fix this problem by moving the rcu_head
> structure up before the cgroup structure.
>
> Fixes: d23b5c577715 ("cgroup: Make operations on the cgroup root_list RCU safe")
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Closes: https://lore.kernel.org/lkml/20231207143806.114e0a74@canb.auug.org.au/
> Signed-off-by: Waiman Long <longman@...hat.com>
> Acked-by: Yafang Shao <laoar.shao@...il.com>
Reviewed-by: Yosry Ahmed <yosryahmed@...gle.com>
Powered by blists - more mailing lists