diff options
author | linke li | 2024-04-27 16:51:54 +0800 |
---|---|---|
committer | Vlastimil Babka | 2024-05-02 14:19:21 +0200 |
commit | 844776cb65a77ef27bfba2220e285940b714ae4e (patch) | |
tree | 741e98a480cb5dead278e4a6cba77f02c08824ad /mm | |
parent | b3d8a8e870144369fdbcbb1a78878ce98532265a (diff) |
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 <lilinke99@qq.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c index 3aa12b9b323d..88d3dcdfa45d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2806,7 +2806,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; } |