Hi all, this series remove unused parameters in functions from
page_table_check. The first 2 patches remove unused mm and addr
parameters in static common functions page_table_check_clear and
page_table_check_set. The last 6 patches remove unused addr parameter
in some externed functions which only need addr for cleaned
page_table_check_clear or page_table_check_set. There is no intended
functional change. Thanks!
Kemeng Shi (8):
mm/page_table_check: remove unused parameters in
page_table_check_clear()
mm/page_table_check: remove unused parameters in
page_table_check_set()
mm/page_table_check: remove unused parameter in
[__]page_table_check_pte_clear
mm/page_table_check: remove unused parameter in
[__]page_table_check_pmd_clear
mm/page_table_check: remove unused parameter in
[__]page_table_check_pud_clear
mm/page_table_check: remove unused parameter in
[__]page_table_check_pte_set
mm/page_table_check: remove unused parameter in
[__]page_table_check_pmd_set
mm/page_table_check: remove unused parameter in
[__]page_table_check_pud_set
arch/arm64/include/asm/pgtable.h | 12 +++---
arch/riscv/include/asm/pgtable.h | 12 +++---
arch/x86/include/asm/pgtable.h | 16 ++++----
include/linux/page_table_check.h | 66 ++++++++++++--------------------
include/linux/pgtable.h | 6 +--
mm/page_table_check.c | 50 +++++++++---------------
6 files changed, 65 insertions(+), 97 deletions(-)
--
2.30.0
Remove unused addr in __page_table_check_pmd_set and
page_table_check_pmd_set.
Signed-off-by: Kemeng Shi <[email protected]>
---
arch/arm64/include/asm/pgtable.h | 4 ++--
arch/riscv/include/asm/pgtable.h | 4 ++--
arch/x86/include/asm/pgtable.h | 4 ++--
include/linux/page_table_check.h | 11 ++++-------
mm/page_table_check.c | 3 +--
5 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index f0a8dcbca04a..1fbf8d3f42b1 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -524,7 +524,7 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd)
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(mm, addr, pmdp, pmd);
+ page_table_check_pmd_set(mm, pmdp, pmd);
return __set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd));
}
@@ -976,7 +976,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
unsigned long address, pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(vma->vm_mm, address, pmdp, pmd);
+ page_table_check_pmd_set(vma->vm_mm, pmdp, pmd);
return __pmd(xchg_relaxed(&pmd_val(*pmdp), pmd_val(pmd)));
}
#endif
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 90063afe8d36..a30658b2611b 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -687,7 +687,7 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd)
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(mm, addr, pmdp, pmd);
+ page_table_check_pmd_set(mm, pmdp, pmd);
return __set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd));
}
@@ -758,7 +758,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
unsigned long address, pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(vma->vm_mm, address, pmdp, pmd);
+ page_table_check_pmd_set(vma->vm_mm, pmdp, pmd);
return __pmd(atomic_long_xchg((atomic_long_t *)pmdp, pmd_val(pmd)));
}
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index d14f0d92f04b..9cc26cb0bc9f 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1030,7 +1030,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(mm, addr, pmdp, pmd);
+ page_table_check_pmd_set(mm, pmdp, pmd);
set_pmd(pmdp, pmd);
}
@@ -1167,7 +1167,7 @@ static inline int pud_write(pud_t pud)
static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
unsigned long address, pmd_t *pmdp, pmd_t pmd)
{
- page_table_check_pmd_set(vma->vm_mm, address, pmdp, pmd);
+ page_table_check_pmd_set(vma->vm_mm, pmdp, pmd);
if (IS_ENABLED(CONFIG_SMP)) {
return xchg(pmdp, pmd);
} else {
diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index 63ebd9fcf28b..dd58dfb0e643 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -18,8 +18,7 @@ void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte);
void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud);
void __page_table_check_pte_set(struct mm_struct *mm, pte_t *ptep, pte_t pte);
-void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
- pmd_t *pmdp, pmd_t pmd);
+void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd);
void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
pud_t *pudp, pud_t pud);
void __page_table_check_pte_clear_range(struct mm_struct *mm,
@@ -75,14 +74,13 @@ static inline void page_table_check_pte_set(struct mm_struct *mm, pte_t *ptep,
__page_table_check_pte_set(mm, ptep, pte);
}
-static inline void page_table_check_pmd_set(struct mm_struct *mm,
- unsigned long addr, pmd_t *pmdp,
+static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
pmd_t pmd)
{
if (static_branch_likely(&page_table_check_disabled))
return;
- __page_table_check_pmd_set(mm, addr, pmdp, pmd);
+ __page_table_check_pmd_set(mm, pmdp, pmd);
}
static inline void page_table_check_pud_set(struct mm_struct *mm,
@@ -132,8 +130,7 @@ static inline void page_table_check_pte_set(struct mm_struct *mm, pte_t *ptep,
{
}
-static inline void page_table_check_pmd_set(struct mm_struct *mm,
- unsigned long addr, pmd_t *pmdp,
+static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
pmd_t pmd)
{
}
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index fc20ddc3a63e..033956704a64 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -195,8 +195,7 @@ void __page_table_check_pte_set(struct mm_struct *mm, pte_t *ptep, pte_t pte)
}
EXPORT_SYMBOL(__page_table_check_pte_set);
-void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
- pmd_t *pmdp, pmd_t pmd)
+void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd)
{
if (&init_mm == mm)
return;
--
2.30.0
Remove unused addr in __page_table_check_pud_clear and
page_table_check_pud_clear.
Signed-off-by: Kemeng Shi <[email protected]>
---
arch/x86/include/asm/pgtable.h | 2 +-
include/linux/page_table_check.h | 11 ++++-------
include/linux/pgtable.h | 2 +-
mm/page_table_check.c | 5 ++---
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 5d71f933d933..f07c610c3458 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1144,7 +1144,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm,
{
pud_t pud = native_pudp_get_and_clear(pudp);
- page_table_check_pud_clear(mm, addr, pud);
+ page_table_check_pud_clear(mm, pud);
return pud;
}
diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index 0f777bca5283..5c9dc848a1bc 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -16,8 +16,7 @@ extern struct page_ext_operations page_table_check_ops;
void __page_table_check_zero(struct page *page, unsigned int order);
void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte);
void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
-void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
- pud_t pud);
+void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud);
void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte);
void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
@@ -60,13 +59,12 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
__page_table_check_pmd_clear(mm, pmd);
}
-static inline void page_table_check_pud_clear(struct mm_struct *mm,
- unsigned long addr, pud_t pud)
+static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
{
if (static_branch_likely(&page_table_check_disabled))
return;
- __page_table_check_pud_clear(mm, addr, pud);
+ __page_table_check_pud_clear(mm, pud);
}
static inline void page_table_check_pte_set(struct mm_struct *mm,
@@ -127,8 +125,7 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
{
}
-static inline void page_table_check_pud_clear(struct mm_struct *mm,
- unsigned long addr, pud_t pud)
+static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
{
}
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 3edef5ed008f..5f36c055794b 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -438,7 +438,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm,
pud_t pud = *pudp;
pud_clear(pudp);
- page_table_check_pud_clear(mm, address, pud);
+ page_table_check_pud_clear(mm, pud);
return pud;
}
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index 51f2274c0a20..2643135bf45c 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -171,8 +171,7 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
}
EXPORT_SYMBOL(__page_table_check_pmd_clear);
-void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
- pud_t pud)
+void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
{
if (&init_mm == mm)
return;
@@ -217,7 +216,7 @@ void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
if (&init_mm == mm)
return;
- __page_table_check_pud_clear(mm, addr, *pudp);
+ __page_table_check_pud_clear(mm, *pudp);
if (pud_user_accessible_page(pud)) {
page_table_check_set(pud_pfn(pud), PUD_SIZE >> PAGE_SHIFT,
pud_write(pud));
--
2.30.0
Remove unused addr in page_table_check_pmd_clear and
__page_table_check_pmd_clear.
Signed-off-by: Kemeng Shi <[email protected]>
---
arch/arm64/include/asm/pgtable.h | 2 +-
arch/riscv/include/asm/pgtable.h | 2 +-
arch/x86/include/asm/pgtable.h | 2 +-
include/linux/page_table_check.h | 11 ++++-------
include/linux/pgtable.h | 2 +-
mm/page_table_check.c | 5 ++---
6 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index f7ea51f9c1c1..6e3387ec6013 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -940,7 +940,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
{
pmd_t pmd = __pmd(xchg_relaxed(&pmd_val(*pmdp), 0));
- page_table_check_pmd_clear(mm, address, pmd);
+ page_table_check_pmd_clear(mm, pmd);
return pmd;
}
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 5e07312cd3e1..388c3af8a9f9 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -742,7 +742,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
{
pmd_t pmd = __pmd(atomic_long_xchg((atomic_long_t *)pmdp, 0));
- page_table_check_pmd_clear(mm, address, pmd);
+ page_table_check_pmd_clear(mm, pmd);
return pmd;
}
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 5085e838b860..5d71f933d933 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1133,7 +1133,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long
{
pmd_t pmd = native_pmdp_get_and_clear(pmdp);
- page_table_check_pmd_clear(mm, addr, pmd);
+ page_table_check_pmd_clear(mm, pmd);
return pmd;
}
diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index 35c53c4b94d3..0f777bca5283 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -15,8 +15,7 @@ extern struct page_ext_operations page_table_check_ops;
void __page_table_check_zero(struct page *page, unsigned int order);
void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte);
-void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
- pmd_t pmd);
+void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
pud_t pud);
void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
@@ -53,13 +52,12 @@ static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
__page_table_check_pte_clear(mm, pte);
}
-static inline void page_table_check_pmd_clear(struct mm_struct *mm,
- unsigned long addr, pmd_t pmd)
+static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
{
if (static_branch_likely(&page_table_check_disabled))
return;
- __page_table_check_pmd_clear(mm, addr, pmd);
+ __page_table_check_pmd_clear(mm, pmd);
}
static inline void page_table_check_pud_clear(struct mm_struct *mm,
@@ -125,8 +123,7 @@ static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
{
}
-static inline void page_table_check_pmd_clear(struct mm_struct *mm,
- unsigned long addr, pmd_t pmd)
+static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
{
}
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index a1ccb13c4853..3edef5ed008f 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -425,7 +425,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
pmd_t pmd = *pmdp;
pmd_clear(pmdp);
- page_table_check_pmd_clear(mm, address, pmd);
+ page_table_check_pmd_clear(mm, pmd);
return pmd;
}
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index a1015fc4d045..51f2274c0a20 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -160,8 +160,7 @@ void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
}
EXPORT_SYMBOL(__page_table_check_pte_clear);
-void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
- pmd_t pmd)
+void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
{
if (&init_mm == mm)
return;
@@ -204,7 +203,7 @@ void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
if (&init_mm == mm)
return;
- __page_table_check_pmd_clear(mm, addr, *pmdp);
+ __page_table_check_pmd_clear(mm, *pmdp);
if (pmd_user_accessible_page(pmd)) {
page_table_check_set(pmd_pfn(pmd), PMD_SIZE >> PAGE_SHIFT,
pmd_write(pmd));
--
2.30.0
Remove unused addr in __page_table_check_pud_set and
page_table_check_pud_set.
Signed-off-by: Kemeng Shi <[email protected]>
---
arch/arm64/include/asm/pgtable.h | 2 +-
arch/riscv/include/asm/pgtable.h | 2 +-
arch/x86/include/asm/pgtable.h | 2 +-
include/linux/page_table_check.h | 11 ++++-------
mm/page_table_check.c | 3 +--
5 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 1fbf8d3f42b1..fe4b913589ee 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -531,7 +531,7 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
pud_t *pudp, pud_t pud)
{
- page_table_check_pud_set(mm, addr, pudp, pud);
+ page_table_check_pud_set(mm, pudp, pud);
return __set_pte_at(mm, addr, (pte_t *)pudp, pud_pte(pud));
}
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index a30658b2611b..44377f0d7c35 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -694,7 +694,7 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
pud_t *pudp, pud_t pud)
{
- page_table_check_pud_set(mm, addr, pudp, pud);
+ page_table_check_pud_set(mm, pudp, pud);
return __set_pte_at(mm, addr, (pte_t *)pudp, pud_pte(pud));
}
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 9cc26cb0bc9f..ada1bbf12961 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1037,7 +1037,7 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
pud_t *pudp, pud_t pud)
{
- page_table_check_pud_set(mm, addr, pudp, pud);
+ page_table_check_pud_set(mm, pudp, pud);
native_set_pud(pudp, pud);
}
diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index dd58dfb0e643..7f6b9bf926c5 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -19,8 +19,7 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud);
void __page_table_check_pte_set(struct mm_struct *mm, pte_t *ptep, pte_t pte);
void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd);
-void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
- pud_t *pudp, pud_t pud);
+void __page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp, pud_t pud);
void __page_table_check_pte_clear_range(struct mm_struct *mm,
unsigned long addr,
pmd_t pmd);
@@ -83,14 +82,13 @@ static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
__page_table_check_pmd_set(mm, pmdp, pmd);
}
-static inline void page_table_check_pud_set(struct mm_struct *mm,
- unsigned long addr, pud_t *pudp,
+static inline void page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp,
pud_t pud)
{
if (static_branch_likely(&page_table_check_disabled))
return;
- __page_table_check_pud_set(mm, addr, pudp, pud);
+ __page_table_check_pud_set(mm, pudp, pud);
}
static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
@@ -135,8 +133,7 @@ static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
{
}
-static inline void page_table_check_pud_set(struct mm_struct *mm,
- unsigned long addr, pud_t *pudp,
+static inline void page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp,
pud_t pud)
{
}
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index 033956704a64..84c8163984e5 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -208,8 +208,7 @@ void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd)
}
EXPORT_SYMBOL(__page_table_check_pmd_set);
-void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
- pud_t *pudp, pud_t pud)
+void __page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp, pud_t pud)
{
if (&init_mm == mm)
return;
--
2.30.0
On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <[email protected]> wrote:
>
> Hi all, this series remove unused parameters in functions from
> page_table_check. The first 2 patches remove unused mm and addr
> parameters in static common functions page_table_check_clear and
> page_table_check_set. The last 6 patches remove unused addr parameter
> in some externed functions which only need addr for cleaned
> page_table_check_clear or page_table_check_set. There is no intended
> functional change. Thanks!
NAK
Both, mm and addr are common arguments that are used for PTE handling
in many parts of memory management even when they are not used in
every function.
Currently, they are not used in page table check, but it is possible
we may need to use them in the future when support for other arches or
different types of page tables (i.e. extended page table) is added. It
is going to be hard to again modify all arch dependent code to add
these arguments back.
Also, internally at Google we are using these arguments, as we have a
module that maps user memory in a way that is incompatible with
upstream, and these arguments are used to support this module.
Thank you,
Pasha
On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin <[email protected]> wrote:
> On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <[email protected]> wrote:
> >
> > Hi all, this series remove unused parameters in functions from
> > page_table_check. The first 2 patches remove unused mm and addr
> > parameters in static common functions page_table_check_clear and
> > page_table_check_set. The last 6 patches remove unused addr parameter
> > in some externed functions which only need addr for cleaned
> > page_table_check_clear or page_table_check_set. There is no intended
> > functional change. Thanks!
>
> NAK
>
> Both, mm and addr are common arguments that are used for PTE handling
> in many parts of memory management even when they are not used in
> every function.
>
> Currently, they are not used in page table check, but it is possible
> we may need to use them in the future when support for other arches or
> different types of page tables (i.e. extended page table) is added. It
> is going to be hard to again modify all arch dependent code to add
> these arguments back.
>
> Also, internally at Google we are using these arguments, as we have a
> module that maps user memory in a way that is incompatible with
> upstream, and these arguments are used to support this module.
>
I don't think these are very good arguments for carrying cruft in the
mainline kernel.
If such an architecture is introduced in the future or if google
upstreams that module then we can restore one or both of these
arguments at that time. This is hardly insurmountable:
arch/arm64/include/asm/pgtable.h | 12 +++---
arch/riscv/include/asm/pgtable.h | 12 +++---
arch/x86/include/asm/pgtable.h | 16 ++++----
include/linux/page_table_check.h | 66 ++++++++++++--------------------
include/linux/pgtable.h | 6 +--
mm/page_table_check.c | 50 +++++++++---------------
6 files changed, 65 insertions(+), 97 deletions(-)
On Mon, Jul 24, 2023 at 1:02 PM Andrew Morton <[email protected]> wrote:
>
> On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin <[email protected]> wrote:
>
> > On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <[email protected]> wrote:
> > >
> > > Hi all, this series remove unused parameters in functions from
> > > page_table_check. The first 2 patches remove unused mm and addr
> > > parameters in static common functions page_table_check_clear and
> > > page_table_check_set. The last 6 patches remove unused addr parameter
> > > in some externed functions which only need addr for cleaned
> > > page_table_check_clear or page_table_check_set. There is no intended
> > > functional change. Thanks!
> >
> > NAK
> >
> > Both, mm and addr are common arguments that are used for PTE handling
> > in many parts of memory management even when they are not used in
> > every function.
> >
> > Currently, they are not used in page table check, but it is possible
> > we may need to use them in the future when support for other arches or
> > different types of page tables (i.e. extended page table) is added. It
> > is going to be hard to again modify all arch dependent code to add
> > these arguments back.
> >
> > Also, internally at Google we are using these arguments, as we have a
> > module that maps user memory in a way that is incompatible with
> > upstream, and these arguments are used to support this module.
> >
>
> I don't think these are very good arguments for carrying cruft in the
> mainline kernel.
>
> If such an architecture is introduced in the future or if google
> upstreams that module then we can restore one or both of these
> arguments at that time. This is hardly insurmountable:
There is another argument: as a follow-up to
https://lore.kernel.org/linux-mm/[email protected]/,
I plan to improve the debugging message instead of simple WARN_ON(), I
want to print more information about what went wrong, what it means,
and what was expected behaviour. Having more data about the mm, and
the addr, is going to be useful for this extended warning message.
set_p**_at functions have prototype like this: set_p**_at(mm, addr,
ptep, pte), in these functions mm, and addr are also not used, as they
call something like: set_pte(ptep, pte); directly, yet having access
to mm, and addr is useful during debugging instead of rewriting them
all over the kernel.
Thank you,
Pasha
>
> arch/arm64/include/asm/pgtable.h | 12 +++---
> arch/riscv/include/asm/pgtable.h | 12 +++---
> arch/x86/include/asm/pgtable.h | 16 ++++----
> include/linux/page_table_check.h | 66 ++++++++++++--------------------
> include/linux/pgtable.h | 6 +--
> mm/page_table_check.c | 50 +++++++++---------------
> 6 files changed, 65 insertions(+), 97 deletions(-)
>
>