Commit 9e247bab authored by Yu Zhao's avatar Yu Zhao Committed by Linus Torvalds

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().

Link: http://lkml.kernel.org/r/20181128235525.58780-1-yuzhao@google.comSigned-off-by: default avatarYu Zhao <yuzhao@google.com>
Reviewed-by: default avatarMatthew Wilcox <willy@infradead.org>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Logan Gunthorpe <logang@deltatee.com>
Cc: Keith Busch <keith.busch@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb416d18
...@@ -1954,13 +1954,6 @@ static inline bool ptlock_init(struct page *page) ...@@ -1954,13 +1954,6 @@ static inline bool ptlock_init(struct page *page)
return true; 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 */ #else /* !USE_SPLIT_PTE_PTLOCKS */
/* /*
* We use mm->page_table_lock to guard all pagetable pages of the mm. * We use mm->page_table_lock to guard all pagetable pages of the mm.
...@@ -1971,7 +1964,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) ...@@ -1971,7 +1964,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
} }
static inline void ptlock_cache_init(void) {} static inline void ptlock_cache_init(void) {}
static inline bool ptlock_init(struct page *page) { return true; } 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 */ #endif /* USE_SPLIT_PTE_PTLOCKS */
static inline void pgtable_init(void) static inline void pgtable_init(void)
...@@ -1991,7 +1984,7 @@ static inline bool pgtable_page_ctor(struct page *page) ...@@ -1991,7 +1984,7 @@ static inline bool pgtable_page_ctor(struct page *page)
static inline void pgtable_page_dtor(struct page *page) static inline void pgtable_page_dtor(struct page *page)
{ {
pte_lock_deinit(page); ptlock_free(page);
__ClearPageTable(page); __ClearPageTable(page);
dec_zone_page_state(page, NR_PAGETABLE); dec_zone_page_state(page, NR_PAGETABLE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment