Files
kernel_nothing_sm7325/include/linux
Waiman Long 047f0ee8b5 cgroup: Move rcu_head up near the top of cgroup_root
commit a7fb0423c201ba12815877a0b5a68a6a1710b23a upstream.

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@canb.auug.org.au>
Closes: https://lore.kernel.org/lkml/20231207143806.114e0a74@canb.auug.org.au/
Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
[Shivani: Modified to apply on v5.4.y]
Signed-off-by: Shivani Agarwal <shivani.agarwal@broadcom.com>
Reviewed-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:44:35 +01:00
..
2019-09-17 10:27:46 -07:00
2020-02-19 19:53:09 +01:00
2022-10-26 13:22:39 +02:00
2019-08-28 21:17:12 -06:00
2024-07-05 09:08:31 +02:00
2023-08-08 19:56:33 +02:00
2023-12-20 15:41:18 +01:00
2020-03-25 08:25:58 +01:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2023-10-25 11:53:22 +02:00
2022-10-26 13:22:46 +02:00
2022-04-15 14:18:32 +02:00
2019-12-13 08:42:53 +01:00
2021-03-04 10:26:29 +01:00
2022-08-25 11:18:04 +02:00
2021-02-07 15:35:49 +01:00
2022-10-07 09:16:54 +02:00
2019-12-13 08:43:18 +01:00
2024-11-17 14:58:53 +01:00
2023-09-23 10:59:40 +02:00
2023-11-20 10:30:10 +01:00
2023-06-21 15:44:10 +02:00
2020-03-18 07:17:46 +01:00
2023-11-28 16:50:16 +00:00
2023-10-25 11:53:18 +02:00
2023-10-25 11:53:18 +02:00
2020-04-02 15:11:00 +02:00
2021-03-07 12:20:49 +01:00
2024-07-05 09:08:31 +02:00
2024-02-23 08:24:47 +01:00
2020-04-02 15:11:00 +02:00
2021-06-10 13:37:14 +02:00