Commit a052f0a5 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

mm: add pt_mm to struct page

For pgd page table pages, x86 overloads the page->index field to store a
pointer to the mm_struct.  Rename this to pt_mm so it's visible to other

Link: default avatarMatthew Wilcox <>
Acked-by: default avatarVlastimil Babka <>
Cc: Christoph Lameter <>
Cc: Dave Hansen <>
Cc: Jérôme Glisse <>
Cc: "Kirill A . Shutemov" <>
Cc: Lai Jiangshan <>
Cc: Martin Schwidefsky <>
Cc: Pekka Enberg <>
Cc: Randy Dunlap <>
Cc: Andrey Ryabinin <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 97b4a671
......@@ -114,13 +114,12 @@ static inline void pgd_list_del(pgd_t *pgd)
static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm));
virt_to_page(pgd)->index = (pgoff_t)mm;
virt_to_page(pgd)->pt_mm = mm;
struct mm_struct *pgd_page_get_mm(struct page *page)
return (struct mm_struct *)page->index;
return page->pt_mm;
static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
......@@ -139,7 +139,7 @@ struct page {
unsigned long _pt_pad_1; /* compound_head */
pgtable_t pmd_huge_pte; /* protected by page->ptl */
unsigned long _pt_pad_2; /* mapping */
unsigned long _pt_pad_3;
struct mm_struct *pt_mm; /* x86 pgds only */
spinlock_t *ptl;
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