mm: remove pte_lock_deinit()
Subsystems (2)
PATCH 1/1 mm: remove pte_lock_deinit()
Pagetable page doesn't touch page->mapping or have any used field that overlaps with it. No need to clear mapping in dtor. In fact, doing so might mask problems that otherwise would be detected by bad_page().
--- include/linux/mm.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
include/linux/mm.h +2 -9
@@ -1900,13 +1900,6 @@ static inline bool ptlock_init(struct page *page) return true; } -/* Reset page->mapping so free_pages_check won't complain. */ -static inline void pte_lock_deinit (struct page *page) -{ - page->mapping =NULL ; -ptlock_free (page); -} -#else /* !USE_SPLIT_PTE_PTLOCKS */ /* * We use mm->page_table_lock to guard all pagetable pages of the mm.
@@ -1917,7 +1910,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) }static inline void ptlock_cache_init (void ) {}static inline bool ptlock_init (struct page *page) {return true; } -static inline void pte_lock_deinit (struct page *page) {} +static inline void ptlock_free (struct page *page) {}#endif /* USE_SPLIT_PTE_PTLOCKS */ static inline void pgtable_init (void )
@@ -1937,7 +1930,7 @@ static inline bool pgtable_page_ctor(struct page *page)static inline void pgtable_page_dtor (struct page *page) { -pte_lock_deinit (page); +ptlock_free (page);__ClearPageTable (page);dec_zone_page_state (page,NR_PAGETABLE ); }
Signature · 1 line
2.20.0.rc1.387.gf8505762e3-goog
Quoted 6 lines · Yu Zhao
Pagetable page doesn't touch
page->mappingor have any used field that overlaps with it. No need to clear mapping in dtor. In fact, doing so might mask problems that otherwise would be detected bybad_page().Signed-off-by Yu Zhao <[email protected]>
I do have plans to use page->mapping for pt_mm, but this patch won't get in my way when I find the round tuits to do that work.
Quoted 4 lines · Yu Zhao
Pagetable page doesn't touch
page->mappingor have any used field that overlaps with it. No need to clear mapping in dtor. In fact, doing so might mask problems that otherwise would be detected bybad_page().
yes the layour of the structure has changed since Hugh introduced the pte lock split
Quoted 1 line
Signed-off-by Yu Zhao <[email protected]>
Quoted 43 lines
--- include/linux/mm.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)include/linux/mm.h +2
-9@@ -1900,13 +1900,6 @@ static inline bool ptlock_init(struct page *page) return true; } -/* Reset page->mapping so free_pages_check won't complain. */ -static inline void pte_lock_deinit (struct page *page) -{ - page->mapping =NULL ; -ptlock_free (page); -} -#else /* !USE_SPLIT_PTE_PTLOCKS */ /* * We use mm->page_table_lock to guard all pagetable pages of the mm. @@ -1917,7 +1910,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) }static inline void ptlock_cache_init (void ) {}static inline bool ptlock_init (struct page *page) {return true; } -static inline void pte_lock_deinit (struct page *page) {} +static inline void ptlock_free (struct page *page) {}#endif /* USE_SPLIT_PTE_PTLOCKS */ static inline void pgtable_init (void )@@ -1937,7 +1930,7 @@ static inline bool pgtable_page_ctor(struct page *page)static inline void pgtable_page_dtor (struct page *page) { -pte_lock_deinit (page); +ptlock_free (page);__ClearPageTable (page);dec_zone_page_state (page,NR_PAGETABLE ); }Signature · 1 line
2.20.0.rc1.387.gf8505762e3-goog
Signature · 2 lines
Michal Hocko SUSE Labs