+ mm-pagewalk-add-test_pd-callbacks.patch added to -mm tree

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

 



The patch titled
     Subject: mm: pagewalk: add test_p?d callbacks
has been added to the -mm tree.  Its filename is
     mm-pagewalk-add-test_pd-callbacks.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-pagewalk-add-test_pd-callbacks.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-pagewalk-add-test_pd-callbacks.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/process/submit-checklist.rst when testing your code ***

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

------------------------------------------------------
From: Steven Price <steven.price@xxxxxxx>
Subject: mm: pagewalk: add test_p?d callbacks

It is useful to be able to skip parts of the page table tree even when
walking without VMAs.  Add test_p?d callbacks similar to test_walk but
which are called just before a table at that level is walked.  If the
callback returns non-zero then the entire table is skipped.

Link: http://lkml.kernel.org/r/20190731154603.41797-14-steven.price@xxxxxxx
Signed-off-by: Steven Price <steven.price@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/mm.h |   11 +++++++++++
 mm/pagewalk.c      |   24 ++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

--- a/include/linux/mm.h~mm-pagewalk-add-test_pd-callbacks
+++ a/include/linux/mm.h
@@ -1466,6 +1466,11 @@ void unmap_vmas(struct mmu_gather *tlb,
  *             value means "do page table walk over the current vma,"
  *             and a negative one means "abort current page table walk
  *             right now." 1 means "skip the current vma."
+ * @test_pmd:  similar to test_walk(), but called for every pmd.
+ * @test_pud:  similar to test_walk(), but called for every pud.
+ * @test_p4d:  similar to test_walk(), but called for every p4d.
+ *             Returning 0 means walk this part of the page tables,
+ *             returning 1 means to skip this range.
  * @mm:        mm_struct representing the target process of page table walk
  * @vma:       vma currently walked (NULL if walking outside vmas)
  * @private:   private data for callbacks' usage
@@ -1493,6 +1498,12 @@ struct mm_walk {
 			     struct mm_walk *walk);
 	int (*test_walk)(unsigned long addr, unsigned long next,
 			struct mm_walk *walk);
+	int (*test_pmd)(unsigned long addr, unsigned long next,
+			pmd_t *pmd_start, struct mm_walk *walk);
+	int (*test_pud)(unsigned long addr, unsigned long next,
+			pud_t *pud_start, struct mm_walk *walk);
+	int (*test_p4d)(unsigned long addr, unsigned long next,
+			p4d_t *p4d_start, struct mm_walk *walk);
 	struct mm_struct *mm;
 	struct vm_area_struct *vma;
 	void *private;
--- a/mm/pagewalk.c~mm-pagewalk-add-test_pd-callbacks
+++ a/mm/pagewalk.c
@@ -32,6 +32,14 @@ static int walk_pmd_range(pud_t *pud, un
 	unsigned long next;
 	int err = 0;
 
+	if (walk->test_pmd) {
+		err = walk->test_pmd(addr, end, pmd_offset(pud, 0UL), walk);
+		if (err < 0)
+			return err;
+		if (err > 0)
+			return 0;
+	}
+
 	pmd = pmd_offset(pud, addr);
 	do {
 again:
@@ -82,6 +90,14 @@ static int walk_pud_range(p4d_t *p4d, un
 	unsigned long next;
 	int err = 0;
 
+	if (walk->test_pud) {
+		err = walk->test_pud(addr, end, pud_offset(p4d, 0UL), walk);
+		if (err < 0)
+			return err;
+		if (err > 0)
+			return 0;
+	}
+
 	pud = pud_offset(p4d, addr);
 	do {
  again:
@@ -124,6 +140,14 @@ static int walk_p4d_range(pgd_t *pgd, un
 	unsigned long next;
 	int err = 0;
 
+	if (walk->test_p4d) {
+		err = walk->test_p4d(addr, end, p4d_offset(pgd, 0UL), walk);
+		if (err < 0)
+			return err;
+		if (err > 0)
+			return 0;
+	}
+
 	p4d = p4d_offset(pgd, addr);
 	do {
 		next = p4d_addr_end(addr, end);
_

Patches currently in -mm which might be from steven.price@xxxxxxx are

mm-add-generic-pd_leaf-macros.patch
arc-mm-add-pd_leaf-definitions.patch
arm-mm-add-pd_leaf-definitions.patch
arm64-mm-add-pd_leaf-definitions.patch
mips-mm-add-pd_leaf-definitions.patch
powerpc-mm-add-pd_leaf-definitions.patch
riscv-mm-add-pd_leaf-definitions.patch
s390-mm-add-pd_leaf-definitions.patch
sparc-mm-add-pd_leaf-definitions.patch
x86-mm-add-pd_leaf-definitions.patch
mm-pagewalk-add-p4d_entry-and-pgd_entry.patch
mm-pagewalk-allow-walking-without-vma.patch
mm-pagewalk-add-test_pd-callbacks.patch
mm-pagewalk-add-depth-parameter-to-pte_hole.patch
x86-mm-point-to-struct-seq_file-from-struct-pg_state.patch
x86-mmefi-convert-ptdump_walk_pgd_level-to-take-a-mm_struct.patch
x86-mm-convert-ptdump_walk_pgd_level_debugfs-to-take-an-mm_struct.patch
x86-mm-convert-ptdump_walk_pgd_level_core-to-take-an-mm_struct.patch
mm-add-generic-ptdump.patch
x86-mm-convert-dump_pagetables-to-use-walk_page_range.patch
arm64-mm-convert-mm-dumpc-to-use-walk_page_range.patch
arm64-mm-display-non-present-entries-in-ptdump.patch




[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