Commit e426a767 authored by linke li's avatar linke li Committed by Liu Shixin
Browse files

mm/slub: mark racy access on slab->freelist

mainline inclusion
from mainline-v6.10-rc1
commit 844776cb65a77ef27bfba2220e285940b714ae4e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAHY3K

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



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

In deactivate_slab(), slab->freelist can be changed concurrently. Mark
data race on slab->freelist as benign using READ_ONCE.

This patch is aimed at reducing the number of benign races reported by
KCSAN in order to focus future debugging effort on harmful races.

Signed-off-by: default avatarlinke li <lilinke99@qq.com>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 2cb51a05
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2490,7 +2490,7 @@ static void deactivate_slab(struct kmem_cache *s, struct slab *slab,
	struct slab new;
	struct slab old;

	if (slab->freelist) {
	if (READ_ONCE(slab->freelist)) {
		stat(s, DEACTIVATE_REMOTE_FREES);
		tail = DEACTIVATE_TO_TAIL;
	}