Re: [PATCH v2 1/2] mm: introduce pmd_install() helper
From: Kirill A. Shutemov <hidden>
Date: 2021-08-31 23:23:08
Also in:
linux-doc, lkml
From: Kirill A. Shutemov <hidden>
Date: 2021-08-31 23:23:08
Also in:
linux-doc, lkml
On Tue, Aug 31, 2021 at 09:21:10PM +0800, Qi Zheng wrote:
Currently we have three times the same few lines repeated in the code. Deduplicate them by newly introduced pmd_install() helper. Signed-off-by: Qi Zheng <redacted> Reviewed-by: David Hildenbrand <redacted> Reviewed-by: Muchun Song <redacted> --- include/linux/mm.h | 1 + mm/filemap.c | 11 ++--------- mm/memory.c | 34 ++++++++++++++++------------------ 3 files changed, 19 insertions(+), 27 deletions(-)diff --git a/include/linux/mm.h b/include/linux/mm.h index a3cc83d64564..0af420a7e382 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h@@ -2463,6 +2463,7 @@ static inline spinlock_t *pud_lock(struct mm_struct *mm, pud_t *pud) return ptl; } +extern void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte); extern void __init pagecache_init(void); extern void __init free_area_init_memoryless_node(int nid); extern void free_initmem(void);
mm/internal.h would be a better fit for the declaration. Otherwise: Acked-by: Kirill A. Shutemov <redacted> -- Kirill A. Shutemov