Re: [PATCH v4 5/7] mm: rework non-root kmem_cache lifecycle management

From: Waiman Long
Date: Mon May 20 2019 - 10:56:55 EST


On 5/14/19 8:06 PM, Shakeel Butt wrote:
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 4e5b4292a763..1ee967b4805e 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -45,6 +45,8 @@ static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work);
> static DECLARE_WORK(slab_caches_to_rcu_destroy_work,
> slab_caches_to_rcu_destroy_workfn);
>
> +static void kmemcg_queue_cache_shutdown(struct percpu_ref *percpu_ref);
> +

kmemcg_queue_cache_shutdown is only defined if CONFIG_MEMCG_KMEM is
defined. If it is not defined, a compilation warning can be produced.
Maybe putting the declaration inside a CONFIG_MEMCG_KMEM block:

diff --git a/mm/slab_common.c b/mm/slab_common.c
index 61d7a96a917b..57ba6cf3dc39 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -45,7 +45,9 @@ static void slab_caches_to_rcu_destroy_workfn(struct
work_stru
ct *work);
Âstatic DECLARE_WORK(slab_caches_to_rcu_destroy_work,
ÂÂÂÂ ÂÂÂ ÂÂÂ slab_caches_to_rcu_destroy_workfn);
Â
+#ifdef CONFIG_MEMCG_KMEM
Âstatic void kmemcg_queue_cache_shutdown(struct percpu_ref *percpu_ref);
+#endif
Â
Â/*
 * Set of flags that will prevent slab merging
--

Cheers,
Longman