diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2019-10-01 11:17:34 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2019-11-06 13:02:43 +0100 |
commit | ecaad8aca20432fa60821282d8ff479629c9f7b9 (patch) | |
tree | f654d60d4a7853d2f4f74d510906831c7eb099fb /include/linux/pagewalk.h | |
parent | ace88f1018b88167a78bafd545d30816d6e207bf (diff) | |
download | lwn-ecaad8aca20432fa60821282d8ff479629c9f7b9.tar.gz lwn-ecaad8aca20432fa60821282d8ff479629c9f7b9.zip |
mm: Add a walk_page_mapping() function to the pagewalk code
For users that want to travers all page table entries pointing into a
region of a struct address_space mapping, introduce a walk_page_mapping()
function.
The walk_page_mapping() function will be initially be used for dirty-
tracking in virtual graphics drivers.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/pagewalk.h')
-rw-r--r-- | include/linux/pagewalk.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pagewalk.h b/include/linux/pagewalk.h index bddd9759bab9..6ec82e92c87f 100644 --- a/include/linux/pagewalk.h +++ b/include/linux/pagewalk.h @@ -24,6 +24,9 @@ struct mm_walk; * "do page table walk over the current vma", returning * a negative value means "abort current page table walk * right now" and returning 1 means "skip the current vma" + * @pre_vma: if set, called before starting walk on a non-null vma. + * @post_vma: if set, called after a walk on a non-null vma, provided + * that @pre_vma and the vma walk succeeded. */ struct mm_walk_ops { int (*pud_entry)(pud_t *pud, unsigned long addr, @@ -39,6 +42,9 @@ struct mm_walk_ops { struct mm_walk *walk); int (*test_walk)(unsigned long addr, unsigned long next, struct mm_walk *walk); + int (*pre_vma)(unsigned long start, unsigned long end, + struct mm_walk *walk); + void (*post_vma)(struct mm_walk *walk); }; /** @@ -62,5 +68,8 @@ int walk_page_range(struct mm_struct *mm, unsigned long start, void *private); int walk_page_vma(struct vm_area_struct *vma, const struct mm_walk_ops *ops, void *private); +int walk_page_mapping(struct address_space *mapping, pgoff_t first_index, + pgoff_t nr, const struct mm_walk_ops *ops, + void *private); #endif /* _LINUX_PAGEWALK_H */ |