Re: [PATCH] cgroup: Fix compilation issue due to cgroup_mutex not being exported

From: Tejun Heo
Date: Thu Apr 17 2025 - 12:28:23 EST


On Thu, Apr 17, 2025 at 07:30:00AM +0000, gaoxu wrote:
> 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@xxxxxxxxx>

Applied to cgroup/for-6.15-fixes.

Thanks.

--
tejun