From: Kexin Sun <kexinsun@smail.nju.edu.cn>
To: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com,
shikemeng@huaweicloud.com, nphamcs@gmail.com, bhe@redhat.com,
baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com,
weixugc@google.com, hannes@cmpxchg.org, david@kernel.org,
mhocko@kernel.org, zhengqi.arch@bytedance.com,
shakeel.butt@linux.dev, lorenzo.stoakes@oracle.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: julia.lawall@inria.fr, xutong.ma@inria.fr,
kexinsun@smail.nju.edu.cn, yunbolyu@smu.edu.sg,
ratnadiraw@smu.edu.sg
Subject: [PATCH] mm: update outdated comments for removed scan_swap_map_slots()
Date: Sat, 21 Mar 2026 18:58:14 +0800 [thread overview]
Message-ID: <20260321105814.7053-1-kexinsun@smail.nju.edu.cn> (raw)
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
Signed-off-by: Kexin Sun <kexinsun@smail.nju.edu.cn>
---
mm/page_io.c | 4 ++--
mm/vmscan.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/page_io.c b/mm/page_io.c
index a2c034660c80..330abc5ab7b4 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 0fc9373e8251..0758ef3b100b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1070,7 +1070,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.
*/
--
2.25.1
next reply other threads:[~2026-03-21 10:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 10:58 Kexin Sun [this message]
2026-03-23 8:57 ` [PATCH] mm: update outdated comments for removed scan_swap_map_slots() David Hildenbrand (Arm)
2026-03-23 9:15 ` Lorenzo Stoakes (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260321105814.7053-1-kexinsun@smail.nju.edu.cn \
--to=kexinsun@smail.nju.edu.cn \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chrisl@kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=julia.lawall@inria.fr \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=nphamcs@gmail.com \
--cc=ratnadiraw@smu.edu.sg \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=weixugc@google.com \
--cc=xutong.ma@inria.fr \
--cc=yuanchu@google.com \
--cc=yunbolyu@smu.edu.sg \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox