[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210302132249.GX2723601@casper.infradead.org>
Date: Tue, 2 Mar 2021 13:22:49 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Zi Yan <ziy@...dia.com>
Cc: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Mike Kravetz <mike.kravetz@...cle.com>
Subject: Re: [PATCH v3 01/25] mm: Introduce struct folio
On Mon, Mar 01, 2021 at 03:26:11PM -0500, Zi Yan wrote:
> > +static inline struct folio *next_folio(struct folio *folio)
> > +{
> > + return folio + folio_nr_pages(folio);
>
> Are you planning to make hugetlb use folio too?
>
> If yes, this might not work if we have CONFIG_SPARSEMEM && !CONFIG_SPARSEMEM_VMEMMAP
> with a hugetlb folio > MAX_ORDER, because struct page might not be virtually contiguous.
> See the experiment I did in [1].
Actually, how about proofing this against a future change?
static inline struct folio *next_folio(struct folio *folio)
{
#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
pfn_t next_pfn = page_to_pfn(&folio->page) + folio_nr_pages(folio);
return (struct folio *)pfn_to_page(next_pfn);
#else
return folio + folio_nr_pages(folio);
#endif
}
(not compiled)
Powered by blists - more mailing lists