From: Kexin Sun Date: Sat, 21 Mar 2026 10:58:14 +0000 (+0800) Subject: mm: update outdated comments for removed scan_swap_map_slots() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2a48f8fb56466488f7525e3349d4e2f45dc5d74;p=thirdparty%2Fkernel%2Flinux.git mm: update outdated comments for removed scan_swap_map_slots() The function scan_swap_map_slots() was removed in commit 0ff67f990bd4 ("mm, swap: remove swap slot cache"). The three comments referencing it simply noted that ->flags can be updated non-atomically by scan_swap_map_slots() to justify a data_race() annotation. Since the function no longer exists, drop the parenthetical reference while keeping the data_race() justification intact: ->flags can still be updated non-atomically by other paths (e.g., swapoff clearing SWP_WRITEOK). Assisted-by: unnamed:deepseek-v3.2 coccinelle Link: https://lkml.kernel.org/r/20260321105814.7053-1-kexinsun@smail.nju.edu.cn Signed-off-by: Kexin Sun Acked-by: David Hildenbrand (Arm) Reviewed-by: Lorenzo Stoakes (Oracle) Cc: Axel Rasmussen Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Johannes Weiner Cc: Julia Lawall Cc: Kairui Song Cc: Kemeng Shi Cc: Michal Hocko Cc: Nhat Pham Cc: Qi Zheng Cc: Shakeel Butt Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- diff --git a/mm/page_io.c b/mm/page_io.c index a2c034660c805..330abc5ab7b44 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -450,14 +450,14 @@ void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug) VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); /* - * ->flags can be updated non-atomically (scan_swap_map_slots), + * ->flags can be updated non-atomically, * but that will never affect SWP_FS_OPS, so the data_race * is safe. */ if (data_race(sis->flags & SWP_FS_OPS)) swap_writepage_fs(folio, swap_plug); /* - * ->flags can be updated non-atomically (scan_swap_map_slots), + * ->flags can be updated non-atomically, * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race * is safe. */ diff --git a/mm/vmscan.c b/mm/vmscan.c index 42f834c508bc0..4bf091b1c8afe 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1065,7 +1065,7 @@ static bool may_enter_fs(struct folio *folio, gfp_t gfp_mask) /* * We can "enter_fs" for swap-cache with only __GFP_IO * providing this isn't SWP_FS_OPS. - * ->flags can be updated non-atomically (scan_swap_map_slots), + * ->flags can be updated non-atomically, * but that will never affect SWP_FS_OPS, so the data_race * is safe. */