Re: [PATCH] cgroup: Fix compilation issue due to cgroup_mutex not being exported
From: Kamalesh Babulal
Date: Thu Apr 17 2025 - 12:16:29 EST
On 4/17/25 1:00 PM, gaoxu wrote:
[...]
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 447ac857e..9e60ff629 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -90,7 +90,7 @@
> DEFINE_MUTEX(cgroup_mutex);
> DEFINE_SPINLOCK(css_set_lock);
>
> -#ifdef CONFIG_PROVE_RCU
> +#if (defined CONFIG_PROVE_RCU || defined CONFIG_LOCKDEP)
> EXPORT_SYMBOL_GPL(cgroup_mutex);
> EXPORT_SYMBOL_GPL(css_set_lock);
> #endif
It can be triggered when CONFIG_LOCK_STAT=y is enabled, which
selects CONFIG_LOCKDEP=y and sets CONFIG_PROVE_RCU=n. The patch
looks good to me.
You may also want to update the description above DEFINE_MUTEX(cgroup_mutex);
to reflect the modifications introduced by this patch.
--
Cheers,
Kamalesh