Skip to content

Commit 844776c

Browse files
linke litehcaster
authored andcommitted
mm/slub: mark racy access on slab->freelist
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: linke li <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent b3d8a8e commit 844776c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,7 @@ static void deactivate_slab(struct kmem_cache *s, struct slab *slab,
28062806
struct slab new;
28072807
struct slab old;
28082808

2809-
if (slab->freelist) {
2809+
if (READ_ONCE(slab->freelist)) {
28102810
stat(s, DEACTIVATE_REMOTE_FREES);
28112811
tail = DEACTIVATE_TO_TAIL;
28122812
}

0 commit comments

Comments
 (0)