+ mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm, powerpc: use vma_kernel_pagesize() in vma_mmu_pagesize()
has been added to the -mm tree.  Its filename is
     mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Dan Williams <dan.j.williams@xxxxxxxxx>
Subject: mm, powerpc: use vma_kernel_pagesize() in vma_mmu_pagesize()

Patch series "mm, smaps: MMUPageSize for device-dax", v3.

Similar to 31383c6865a5 ("mm, hugetlbfs: introduce ->split() to
vm_operations_struct") here is another occasion where we want special-case
hugetlbfs/hstate enabling to also apply to device-dax.

This prompts the question what other hstate conversions we might do beyond
->split() and ->pagesize(), but this appears to be the last of the usages
of hstate_vma() in generic/non-hugetlbfs specific code paths.


This patch (of 3):

The current powerpc definition of vma_mmu_pagesize() open codes looking up
the page size via hstate.  It is identical to the generic
vma_kernel_pagesize() implementation.

Now, vma_kernel_pagesize() is growing support for determining the page
size of Device-DAX vmas in addition to the existing Hugetlbfs page size
determination.

Ideally, if the powerpc vma_mmu_pagesize() used vma_kernel_pagesize() it
would automatically benefit from any new vma-type support that is added to
vma_kernel_pagesize().  However, the powerpc vma_mmu_pagesize() is
prevented from calling vma_kernel_pagesize() due to a circular header
dependency that requires vma_mmu_pagesize() to be defined before including
<linux/hugetlb.h>.

Break this circular dependency by defining the default vma_mmu_pagesize()
as a __weak symbol to be overridden by the powerpc version.

Link: http://lkml.kernel.org/r/151996254179.27922.2213728278535578744.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Jane Chu <jane.chu@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/powerpc/include/asm/hugetlb.h |    6 ------
 arch/powerpc/mm/hugetlbpage.c      |    5 +----
 mm/hugetlb.c                       |    8 +++-----
 3 files changed, 4 insertions(+), 15 deletions(-)

diff -puN arch/powerpc/include/asm/hugetlb.h~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize arch/powerpc/include/asm/hugetlb.h
--- a/arch/powerpc/include/asm/hugetlb.h~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize
+++ a/arch/powerpc/include/asm/hugetlb.h
@@ -118,12 +118,6 @@ void hugetlb_free_pgd_range(struct mmu_g
 			    unsigned long ceiling);
 
 /*
- * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
- * to override the version in mm/hugetlb.c
- */
-#define vma_mmu_pagesize vma_mmu_pagesize
-
-/*
  * If the arch doesn't supply something else, assume that hugepage
  * size aligned regions are ok without further preparation.
  */
diff -puN arch/powerpc/mm/hugetlbpage.c~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize arch/powerpc/mm/hugetlbpage.c
--- a/arch/powerpc/mm/hugetlbpage.c~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize
+++ a/arch/powerpc/mm/hugetlbpage.c
@@ -568,10 +568,7 @@ unsigned long vma_mmu_pagesize(struct vm
 	if (!radix_enabled())
 		return 1UL << mmu_psize_to_shift(psize);
 #endif
-	if (!is_vm_hugetlb_page(vma))
-		return PAGE_SIZE;
-
-	return huge_page_size(hstate_vma(vma));
+	return vma_kernel_pagesize(vma);
 }
 
 static inline bool is_power_of_4(unsigned long x)
diff -puN mm/hugetlb.c~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize mm/hugetlb.c
--- a/mm/hugetlb.c~mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize
+++ a/mm/hugetlb.c
@@ -650,15 +650,13 @@ EXPORT_SYMBOL_GPL(vma_kernel_pagesize);
 /*
  * Return the page size being used by the MMU to back a VMA. In the majority
  * of cases, the page size used by the kernel matches the MMU size. On
- * architectures where it differs, an architecture-specific version of this
- * function is required.
+ * architectures where it differs, an architecture-specific 'strong'
+ * version of this symbol is required.
  */
-#ifndef vma_mmu_pagesize
-unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
+__weak unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
 {
 	return vma_kernel_pagesize(vma);
 }
-#endif
 
 /*
  * Flags for MAP_PRIVATE reservations.  These are stored in the bottom
_

Patches currently in -mm which might be from dan.j.williams@xxxxxxxxx are

mm-powerpc-use-vma_kernel_pagesize-in-vma_mmu_pagesize.patch
mm-hugetlbfs-introduce-pagesize-to-vm_operations_struct.patch
device-dax-implement-pagesize-for-smaps-to-report-mmupagesize.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux