Skip to content

Commit 87c259a

Browse files
gaoxuhtejun
authored andcommitted
cgroup: Fix compilation issue due to cgroup_mutex not being exported
When adding folio_memcg function call in the zram module for Android16-6.12, the following error occurs during compilation: ERROR: modpost: "cgroup_mutex" [../soc-repo/zram.ko] undefined! This error is caused by the indirect call to lockdep_is_held(&cgroup_mutex) within folio_memcg. The export setting for cgroup_mutex is controlled by the CONFIG_PROVE_RCU macro. If CONFIG_LOCKDEP is enabled while CONFIG_PROVE_RCU is not, this compilation error will occur. To resolve this issue, add a parallel macro CONFIG_LOCKDEP control to ensure cgroup_mutex is properly exported when needed. Signed-off-by: gao xu <gaoxu2@honor.com> Acked-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent cfb2e2c commit 87c259a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cgroup/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
DEFINE_MUTEX(cgroup_mutex);
9191
DEFINE_SPINLOCK(css_set_lock);
9292

93-
#ifdef CONFIG_PROVE_RCU
93+
#if (defined CONFIG_PROVE_RCU || defined CONFIG_LOCKDEP)
9494
EXPORT_SYMBOL_GPL(cgroup_mutex);
9595
EXPORT_SYMBOL_GPL(css_set_lock);
9696
#endif

0 commit comments

Comments
 (0)