Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <kexinsun@smail.nju.edu.cn>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Julia Lawall <julia.lawall@inria.fr>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kexin Sun and committed by
Andrew Morton
f2a48f8f 3cb0dc0d

+3 -3
+2 -2
mm/page_io.c
··· 450 450 451 451 VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); 452 452 /* 453 - * ->flags can be updated non-atomically (scan_swap_map_slots), 453 + * ->flags can be updated non-atomically, 454 454 * but that will never affect SWP_FS_OPS, so the data_race 455 455 * is safe. 456 456 */ 457 457 if (data_race(sis->flags & SWP_FS_OPS)) 458 458 swap_writepage_fs(folio, swap_plug); 459 459 /* 460 - * ->flags can be updated non-atomically (scan_swap_map_slots), 460 + * ->flags can be updated non-atomically, 461 461 * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race 462 462 * is safe. 463 463 */
+1 -1
mm/vmscan.c
··· 1065 1065 /* 1066 1066 * We can "enter_fs" for swap-cache with only __GFP_IO 1067 1067 * providing this isn't SWP_FS_OPS. 1068 - * ->flags can be updated non-atomically (scan_swap_map_slots), 1068 + * ->flags can be updated non-atomically, 1069 1069 * but that will never affect SWP_FS_OPS, so the data_race 1070 1070 * is safe. 1071 1071 */