Commit c5b419c2 authored by Chengming Zhou's avatar Chengming Zhou Committed by Peng Zhang
Browse files

mm/slub: remove full list manipulation for non-debug slab

mainline inclusion
from mainline-v6.9-rc1
commit a6def11b6dcde5d8f1fcc9e2c0ae71399432b62e
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/I9CSFJ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a6def11b6dcde5d8f1fcc9e2c0ae71399432b62e



--------------------------------

Since debug slab is processed by free_to_partial_list(), and only debug
slab which has SLAB_STORE_USER flag would care about the full list, we
can remove these unrelated full list manipulations from __slab_free().

Acked-by: default avatarChristoph Lameter (Ampere) <cl@linux.com>
Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarChengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent e7ddd47b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -3673,7 +3673,6 @@ static void __slab_free(struct kmem_cache *s, struct slab *slab,
	 * then add it.
	 */
	if (!kmem_cache_has_cpu_partial(s) && unlikely(!prior)) {
		remove_full(s, n, slab);
		add_partial(n, slab, DEACTIVATE_TO_TAIL);
		stat(s, FREE_ADD_PARTIAL);
	}
@@ -3687,9 +3686,6 @@ static void __slab_free(struct kmem_cache *s, struct slab *slab,
		 */
		remove_partial(n, slab);
		stat(s, FREE_REMOVE_PARTIAL);
	} else {
		/* Slab must be on the full list */
		remove_full(s, n, slab);
	}

	spin_unlock_irqrestore(&n->list_lock, flags);