From: Baoquan He <bhe@redhat.com>
To: Youngjun Park <youngjun.park@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Kemeng Shi <shikemeng@huaweicloud.com>,
Kairui Song <kasong@tencent.com>, Nhat Pham <nphamcs@gmail.com>,
Barry Song <baohua@kernel.org>, Chris Li <chrisl@kernel.org>
Subject: Re: [PATCH v2 5/5] mm: swap: remove scan_swap_map_slots() references from comments
Date: Sat, 1 Nov 2025 08:03:54 +0800 [thread overview]
Message-ID: <aQVOagpCX4GhEu1P@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20251031065011.40863-6-youngjun.park@lge.com>
On 10/31/25 at 03:50pm, Youngjun Park wrote:
> 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.
>
> Signed-off-by: Youngjun Park <youngjun.park@lge.com>
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 4f8a1843262e..543f303f101d 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
Reviewed-by: Baoquan He <bhe@redhat.com>
> @@ -236,11 +236,10 @@ static int __try_to_reclaim_swap(struct swap_info_struct *si,
> ret = -nr_pages;
>
> /*
> - * When this function is called from scan_swap_map_slots() and it's
> - * called by vmscan.c at reclaiming folios. So we hold a folio lock
> - * here. We have to use trylock for avoiding deadlock. This is a special
> - * case and you should use folio_free_swap() with explicit folio_lock()
> - * in usual operations.
> + * We hold a folio lock here. We have to use trylock for
> + * avoiding deadlock. This is a special case and you should
> + * use folio_free_swap() with explicit folio_lock() in usual
> + * operations.
> */
> if (!folio_trylock(folio))
> goto out;
> @@ -1365,14 +1364,13 @@ static void swap_alloc_slow(swp_entry_t *entry,
> spin_lock(&swap_avail_lock);
> /*
> * if we got here, it's likely that si was almost full before,
> - * and since scan_swap_map_slots() can drop the si->lock,
> * multiple callers probably all tried to get a page from the
> * same si and it filled up before we could get one; or, the si
> - * filled up between us dropping swap_avail_lock and taking
> - * si->lock. Since we dropped the swap_avail_lock, the
> - * swap_avail_head list may have been modified; so if next is
> - * still in the swap_avail_head list then try it, otherwise
> - * start over if we have not gotten any slots.
> + * filled up between us dropping swap_avail_lock.
> + * Since we dropped the swap_avail_lock, the swap_avail_list
> + * may have been modified; so if next is still in the
> + * swap_avail_head list then try it, otherwise start over if we
> + * have not gotten any slots.
> */
> if (plist_node_empty(&si->avail_list))
> goto start_over;
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-11-01 0:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 6:50 [PATCH v2 0/5] mm: swap: small fixes and comment cleanups Youngjun Park
2025-10-31 6:50 ` [PATCH v2 1/5] mm, swap: Fix memory leak in setup_clusters() error path Youngjun Park
2025-11-01 0:01 ` Baoquan He
2025-11-05 4:30 ` Chris Li
2025-10-31 6:50 ` [PATCH v2 2/5] mm, swap: Use SWP_SOLIDSTATE to determine if swap is rotational Youngjun Park
2025-11-01 0:02 ` Baoquan He
2025-11-05 4:30 ` Chris Li
2025-10-31 6:50 ` [PATCH v2 3/5] mm, swap: Remove redundant comment for read_swap_cache_async Youngjun Park
2025-11-01 0:02 ` Baoquan He
2025-11-05 6:03 ` Chris Li
2025-11-05 7:58 ` Chris Li
2025-11-05 9:27 ` YoungJun Park
2025-11-06 0:29 ` Andrew Morton
2025-11-20 5:00 ` Chris Li
2025-11-20 16:54 ` Andrew Morton
2025-11-20 18:34 ` Chris Li
2025-10-31 6:50 ` [PATCH v2 4/5] mm: swap: change swap_alloc_slow() to void Youngjun Park
2025-11-01 0:03 ` Baoquan He
2025-11-05 6:04 ` Chris Li
2025-10-31 6:50 ` [PATCH v2 5/5] mm: swap: remove scan_swap_map_slots() references from comments Youngjun Park
2025-11-01 0:03 ` Baoquan He [this message]
2025-11-05 6:50 ` Chris Li
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=aQVOagpCX4GhEu1P@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=chrisl@kernel.org \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=shikemeng@huaweicloud.com \
--cc=youngjun.park@lge.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