Skip to content

Commit b7dd80f

Browse files
youngjuniakpm00
authored andcommitted
mm: swap: remove scan_swap_map_slots() references from comments
The scan_swap_map_slots() helper has been removed, but several comments still referred to it in swap allocation and reclaim paths. This patch cleans up those outdated references and reflows the affected comment blocks to match kernel coding style. Link: https://lkml.kernel.org/r/20251031065011.40863-6-youngjun.park@lge.com Signed-off-by: Youngjun Park <youngjun.park@lge.com> Reviewed-by: Baoquan He <bhe@redhat.com> Acked-by: Chris Li <chrisl@kernel.org> Cc: Barry Song <baohua@kernel.org> Cc: Kairui Song <kasong@tencent.com> Cc: Kemeng Shi <shikemeng@huaweicloud.com> Cc: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 4c239d5 commit b7dd80f

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

mm/swapfile.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,10 @@ static int __try_to_reclaim_swap(struct swap_info_struct *si,
236236
ret = -nr_pages;
237237

238238
/*
239-
* When this function is called from scan_swap_map_slots() and it's
240-
* called by vmscan.c at reclaiming folios. So we hold a folio lock
241-
* here. We have to use trylock for avoiding deadlock. This is a special
242-
* case and you should use folio_free_swap() with explicit folio_lock()
243-
* in usual operations.
239+
* We hold a folio lock here. We have to use trylock for
240+
* avoiding deadlock. This is a special case and you should
241+
* use folio_free_swap() with explicit folio_lock() in usual
242+
* operations.
244243
*/
245244
if (!folio_trylock(folio))
246245
goto out;
@@ -1365,14 +1364,13 @@ static void swap_alloc_slow(swp_entry_t *entry,
13651364
spin_lock(&swap_avail_lock);
13661365
/*
13671366
* if we got here, it's likely that si was almost full before,
1368-
* and since scan_swap_map_slots() can drop the si->lock,
13691367
* multiple callers probably all tried to get a page from the
13701368
* same si and it filled up before we could get one; or, the si
1371-
* filled up between us dropping swap_avail_lock and taking
1372-
* si->lock. Since we dropped the swap_avail_lock, the
1373-
* swap_avail_head list may have been modified; so if next is
1374-
* still in the swap_avail_head list then try it, otherwise
1375-
* start over if we have not gotten any slots.
1369+
* filled up between us dropping swap_avail_lock.
1370+
* Since we dropped the swap_avail_lock, the swap_avail_list
1371+
* may have been modified; so if next is still in the
1372+
* swap_avail_head list then try it, otherwise start over if we
1373+
* have not gotten any slots.
13761374
*/
13771375
if (plist_node_empty(&next->avail_list))
13781376
goto start_over;

0 commit comments

Comments
 (0)