[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200428194449.22615-3-willy@infradead.org>
Date: Tue, 28 Apr 2020 12:44:44 -0700
From: Matthew Wilcox <willy@...radead.org>
To: linux-mm@...ck.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Russell King <linux@...linux.org.uk>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-m68k@...ts.linux-m68k.org
Subject: [PATCH 2/7] mm: Move pt_mm within struct page
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Instead of a per-arch word within struct page, use a formerly reserved
word. This word is shared with page->mapping, so it must be cleared
before being freed as it is checked in free_pages().
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
arch/x86/mm/pgtable.c | 1 +
include/linux/mm_types.h | 7 ++-----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 7bd2c3a52297..f5f46737aea0 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -95,6 +95,7 @@ static inline void pgd_list_del(pgd_t *pgd)
struct page *page = virt_to_page(pgd);
list_del(&page->lru);
+ page->pt_mm = NULL;
}
#define UNSHARED_PTRS_PER_PGD \
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 9bb34e2cd5a5..7efa12f4626f 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -149,11 +149,8 @@ struct page {
pgtable_t pmd_huge_pte;
};
};
- unsigned long _pt_pad_2; /* mapping */
- union {
- struct mm_struct *pt_mm; /* x86 pgds only */
- atomic_t pt_frag_refcount; /* powerpc */
- };
+ struct mm_struct *pt_mm;
+ atomic_t pt_frag_refcount; /* powerpc */
#if ALLOC_SPLIT_PTLOCKS
spinlock_t *ptl;
#else
--
2.26.2
Powered by blists - more mailing lists