linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Eric Biggers <ebiggers@kernel.org>
Subject: Re: [PATCH] mm: Move nth_page from folio_page into folio_next
Date: Thu, 13 Mar 2025 21:40:02 -0400	[thread overview]
Message-ID: <EBEF95E8-92ED-4381-A001-E7206FD0E1A7@nvidia.com> (raw)
In-Reply-To: <Z9OD5MsHZnzG4Smt@gondor.apana.org.au>

On 13 Mar 2025, at 21:18, Herbert Xu wrote:

> On Thu, Mar 13, 2025 at 12:25:50PM +0000, Matthew Wilcox wrote:
>>
>> That isn't true.  HugeTLB can construct a folio which crosses a
>> contiguity boundary.
>
> Thanks.  So thea means we do need to use nth_page when iterating
> through a folio or a scatterlist generated from a folio.

When you know the folio is hugetlb with gigantic order. Folios
come out of buddy allocator are all within contiguity boundaries.
To be precise, the boundary here means a section boundary.

In addition, nth_page() is a trivial addition for SPARSEMEM_VMEMMAP
or FLATMEM. For SPARSEMEM && !SPARSEMEM_VMEMMAP, it needs to use
pfn for the calculation.

Best Regards,
Yan, Zi


      reply	other threads:[~2025-03-14  1:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  4:40 Herbert Xu
2025-03-13 12:25 ` Matthew Wilcox
2025-03-14  1:18   ` Herbert Xu
2025-03-14  1:40     ` Zi Yan [this message]

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=EBEF95E8-92ED-4381-A001-E7206FD0E1A7@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiggers@kernel.org \
    --cc=hch@lst.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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