Re: [PATCH v3 04/12] mm, swap: add support for stable large allocation in swap cache directly
From: Kairui Song
Date: Thu May 14 2026 - 02:12:02 EST
On Thu, May 14, 2026 at 1:53 AM YoungJun Park <youngjun.park@xxxxxxx> wrote:
>
> On Tue, Apr 21, 2026 at 02:16:48PM +0800, Kairui Song via B4 Relay wrote:
> ...
> > static struct folio *swap_cache_read_folio(swp_entry_t entry, gfp_t gfp,
> > struct mempolicy *mpol, pgoff_t ilx,
> > struct swap_iocb **plug, bool readahead)
> > {
> > - struct swap_info_struct *si = __swap_entry_to_info(entry);
> > struct folio *folio;
> >
> > /* Check the swap cache again for readahead path. */
> > @@ -594,16 +700,12 @@ static struct folio *swap_cache_read_folio(swp_entry_t entry, gfp_t gfp,
> > if (folio)
> > return folio;
> > - /* Skip allocation for unused and bad swap slot for readahead. */
> > - if (!swap_entry_swapped(si, entry))
> > - return NULL;
> > -
>
> Hello Kairui
>
> With the swap_entry_swapped() check gone, the swap_cache_get_folio()
> above the do-while is now just a duplicate of the loop's first
> iteration. Might as well drop it (and the now-stale "again for readahead
> path" comment) here.
Ah, very nice observation! Thanks, will drop it.