linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (Oracle)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	 linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH v1 1/4] mm: move vma_kernel_pagesize() from hugetlb to mm.h
Date: Mon, 9 Mar 2026 13:44:27 +0000	[thread overview]
Message-ID: <27d52c59-e68f-4369-b133-4db71e1de0c6@lucifer.local> (raw)
In-Reply-To: <729e14d4-6949-4d46-9380-12331b5ad363@kernel.org>

On Fri, Mar 06, 2026 at 02:25:51PM +0100, David Hildenbrand (Arm) wrote:
> On 3/6/26 12:07, Lorenzo Stoakes (Oracle) wrote:
> > On Fri, Mar 06, 2026 at 11:15:57AM +0100, David Hildenbrand (Arm) wrote:
> >> In the past, only hugetlb had special "vma_kernel_pagesize()"
> >> requirements, so it provided its own implementation.
> >>
> >> In commit 05ea88608d4e ("mm, hugetlbfs: introduce ->pagesize() to
> >> vm_operations_struct") we generalized that approach by providing a
> >> vm_ops->pagesize() callback to be used by device-dax.
> >>
> >> Once device-dax started using that callback in commit c1d53b92b95c
> >> ("device-dax: implement ->pagesize() for smaps to report MMUPageSize")
> >> it was missed that CONFIG_DEV_DAX does not depend on hugetlb support.
> >>
> >> So building a kernel with CONFIG_DEV_DAX but without CONFIG_HUGETLBFS
> >> would not pick up that value.
> >>
> >> Fix it by moving vma_kernel_pagesize() to mm.h, providing only a single
> >> implementation. While at it, improve the kerneldoc a bit.
> >>
> >> Ideally, we'd move vma_mmu_pagesize() as well to the header. However,
> >> its __weak symbol might be overwritten by a PPC variant in hugetlb code.
> >> So let's leave it in there for now, as it really only matters for some
> >> hugetlb oddities.
> >>
> >> This was found by code inspection.
> >>
> >> Fixes: c1d53b92b95c ("device-dax: implement ->pagesize() for smaps to report MMUPageSize")
> >> Cc: Dan Williams <dan.j.williams@intel.com>
> >> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
> >
> > LGTM, but you need to fix up VMA tests, I attach a patch below to do this. Will
> > this resolved:
>
> Thanks!
>
> I assume that should go into patch #2 instead?

(Sorry missed this on first reply)

It doesn't matter too much from compilation point of view but thought it made
more sense as this is where you pull vma_kernel_pagesize() in? But I'm fine with
either!

Cheers, Lorenzo


  parent reply	other threads:[~2026-03-09 13:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 10:15 [PATCH v1 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c David Hildenbrand (Arm)
2026-03-06 10:15 ` [PATCH v1 1/4] mm: move vma_kernel_pagesize() from hugetlb to mm.h David Hildenbrand (Arm)
2026-03-06 11:07   ` Lorenzo Stoakes (Oracle)
2026-03-06 13:25     ` David Hildenbrand (Arm)
2026-03-09 13:41       ` Lorenzo Stoakes (Oracle)
2026-03-09 13:47         ` David Hildenbrand (Arm)
2026-03-09 13:44       ` Lorenzo Stoakes (Oracle) [this message]
2026-03-06 10:15 ` [PATCH v1 2/4] mm: move vma_mmu_pagesize() from hugetlb to vma.c David Hildenbrand (Arm)
2026-03-06 11:11   ` Lorenzo Stoakes (Oracle)
2026-03-06 10:15 ` [PATCH v1 3/4] KVM: remove hugetlb.h inclusion David Hildenbrand (Arm)
2026-03-06 11:11   ` Lorenzo Stoakes (Oracle)
2026-03-06 13:27     ` David Hildenbrand (Arm)
2026-03-06 10:16 ` [PATCH v1 4/4] KVM: PPC: " David Hildenbrand (Arm)
2026-03-06 11:12   ` Lorenzo Stoakes (Oracle)
2026-03-06 11:13 ` [PATCH v1 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c Pedro Falcato
2026-03-06 11:19   ` Lorenzo Stoakes (Oracle)
2026-03-06 13:12     ` David Hildenbrand (Arm)
2026-03-09 13:42       ` Lorenzo Stoakes (Oracle)
2026-03-09 15:07         ` David Hildenbrand (Arm)
2026-03-10 10:42           ` Vlastimil Babka
2026-03-06 15:30 ` Mike Rapoport

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=27d52c59-e68f-4369-b133-4db71e1de0c6@lucifer.local \
    --to=ljs@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.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