mm/slub: remove the check of !kmem_cache_has_cpu_partial()
authorXiongwei Song <xiongwei.song@windriver.com>
Thu, 4 Apr 2024 05:58:24 +0000 (13:58 +0800)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 4 Apr 2024 09:10:35 +0000 (11:10 +0200)
The check of !kmem_cache_has_cpu_partial(s) with
CONFIG_SLUB_CPU_PARTIAL enabled here is always false.

We have already checked kmem_cache_debug() earlier and if it was true,
then we either continued or broke from the loop so we can't reach this
code in that case and don't need to check kmem_cache_debug() as part of
kmem_cache_has_cpu_partial() again. Here we can remove it.

Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c

index f152b5df8ab2e4a1f16aa74168c38f2991fa145a..2e0351066c5d817b9f7c3f122b4badf09f57f398 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2610,8 +2610,7 @@ static struct slab *get_partial_node(struct kmem_cache *s,
                        partial_slabs++;
                }
 #ifdef CONFIG_SLUB_CPU_PARTIAL
-               if (!kmem_cache_has_cpu_partial(s)
-                       || partial_slabs > s->cpu_partial_slabs / 2)
+               if (partial_slabs > s->cpu_partial_slabs / 2)
                        break;
 #else
                break;