[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200426174058.1181837-1-jiaxun.yang@flygoat.com>
Date: Mon, 27 Apr 2020 01:40:55 +0800
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: akpm@...ux-foundation.org
Cc: sunguoyun@...ngson.cn, Jiaxun Yang <jiaxun.yang@...goat.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Philippe Mathieu-Daudé <f4bug@...at.org>,
Daniel Silsby <dansilsby@...il.com>,
Dmitry Korotin <dkorotin@...ecomp.com>,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] mips/mm: Guard SOFT_DIRTY bit with config option
After guarding SOFT_DIRTY with config option, it won't occupy
precious page table bit on systems that didn't enable SOFT_DIRTY.
It can prevent page btis overflow on MIPS32R2 systems with RIXI
enabled.
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Reported-by: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
---
arch/mips/include/asm/pgtable-bits.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index d43fb6f8af14..e26dc41a8a68 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -55,7 +55,9 @@ enum pgtable_bits {
#if defined(CONFIG_ARCH_HAS_PTE_SPECIAL)
_PAGE_SPECIAL_SHIFT,
#endif
+#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY)
_PAGE_SOFT_DIRTY_SHIFT,
+#endif
};
/*
@@ -85,7 +87,9 @@ enum pgtable_bits {
#if defined(CONFIG_ARCH_HAS_PTE_SPECIAL)
_PAGE_SPECIAL_SHIFT,
#endif
+#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY)
_PAGE_SOFT_DIRTY_SHIFT,
+#endif
};
#elif defined(CONFIG_CPU_R3K_TLB)
@@ -101,7 +105,9 @@ enum pgtable_bits {
#if defined(CONFIG_ARCH_HAS_PTE_SPECIAL)
_PAGE_SPECIAL_SHIFT,
#endif
+#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY)
_PAGE_SOFT_DIRTY_SHIFT,
+#endif
/* Used by TLB hardware (placed in EntryLo) */
_PAGE_GLOBAL_SHIFT = 8,
@@ -128,7 +134,9 @@ enum pgtable_bits {
#if defined(CONFIG_ARCH_HAS_PTE_SPECIAL)
_PAGE_SPECIAL_SHIFT,
#endif
+#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY)
_PAGE_SOFT_DIRTY_SHIFT,
+#endif
/* Used by TLB hardware (placed in EntryLo*) */
#if defined(CONFIG_CPU_HAS_RIXI)
_PAGE_NO_EXEC_SHIFT,
@@ -155,7 +163,11 @@ enum pgtable_bits {
#else
# define _PAGE_SPECIAL 0
#endif
-#define _PAGE_SOFT_DIRTY (1 << _PAGE_SOFT_DIRTY_SHIFT)
+#if defined(CONFIG_HAVE_ARCH_SOFT_DIRTY)
+# define _PAGE_SOFT_DIRTY (1 << _PAGE_SOFT_DIRTY_SHIFT)
+#else
+# define _PAGE_SOFT_DIRTY 0
+#endif
/* Used by TLB hardware (placed in EntryLo*) */
#if defined(CONFIG_XPA)
--
2.26.0.rc2
Powered by blists - more mailing lists