[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zl20pc-YlIWCSy6Z@casper.infradead.org>
Date: Mon, 3 Jun 2024 13:18:45 +0100
From: Matthew Wilcox <willy@...radead.org>
To: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
Cc: david@...morbit.com, chandan.babu@...cle.com, akpm@...ux-foundation.org,
brauner@...nel.org, djwong@...nel.org, linux-kernel@...r.kernel.org,
hare@...e.de, john.g.garry@...cle.com, gost.dev@...sung.com,
yang@...amperecomputing.com, p.raghav@...sung.com,
cl@...amperecomputing.com, linux-xfs@...r.kernel.org, hch@....de,
mcgrof@...nel.org, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v6 03/11] filemap: allocate mapping_min_order folios in
the page cache
On Wed, May 29, 2024 at 03:45:01PM +0200, Pankaj Raghav (Samsung) wrote:
> @@ -1919,8 +1921,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
> folio_wait_stable(folio);
> no_page:
> if (!folio && (fgp_flags & FGP_CREAT)) {
> - unsigned order = FGF_GET_ORDER(fgp_flags);
> + unsigned int min_order = mapping_min_folio_order(mapping);
> + unsigned int order = max(min_order, FGF_GET_ORDER(fgp_flags));
> int err;
> + index = mapping_align_start_index(mapping, index);
>
> if ((fgp_flags & FGP_WRITE) && mapping_can_writeback(mapping))
> gfp |= __GFP_WRITE;
> @@ -1958,7 +1962,7 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
> break;
> folio_put(folio);
> folio = NULL;
> - } while (order-- > 0);
> + } while (order-- > min_order);
I'd argue you also need to change:
- if (order > 0)
+ if (order > min_order)
alloc_gfp |= __GFP_NORETRY | __GFP_NOWARN;
since that is the last point at which we can fall back. If we can't
immediately allocate a min_order folio, we want to retry, and we
want to warn if we can't get it.
Powered by blists - more mailing lists