linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb()
@ 2020-10-19 21:10 Richard Weinberger
  2020-10-20  1:51 ` Matthew Wilcox
  2020-10-23 14:47 ` Christopher Obbard
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Weinberger @ 2020-10-19 21:10 UTC (permalink / raw)
  To: linux-um; +Cc: linux-kernel, willy, anton.ivanov, Richard Weinberger

Commit b2b29d6d0119 ("mm: account PMD tables like PTE tables") uncovered
a bug in uml, we forgot to call the destructor.
While we are here, give x a sane name.

Reported-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Co-developed-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/include/asm/pgalloc.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 5393e13e07e0..2bbf28cf3aa9 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -33,7 +33,13 @@ do {							\
 } while (0)
 
 #ifdef CONFIG_3_LEVEL_PGTABLES
-#define __pmd_free_tlb(tlb,x, address)   tlb_remove_page((tlb),virt_to_page(x))
+
+#define __pmd_free_tlb(tlb, pmd, address)		\
+do {							\
+	pgtable_pmd_page_dtor(virt_to_page(pmd));	\
+	tlb_remove_page((tlb),virt_to_page(pmd));	\
+} while (0)						\
+
 #endif
 
 #endif
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb()
  2020-10-19 21:10 [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb() Richard Weinberger
@ 2020-10-20  1:51 ` Matthew Wilcox
  2020-10-23 14:47 ` Christopher Obbard
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2020-10-20  1:51 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-um, linux-kernel, anton.ivanov

On Mon, Oct 19, 2020 at 11:10:49PM +0200, Richard Weinberger wrote:
> Commit b2b29d6d0119 ("mm: account PMD tables like PTE tables") uncovered
> a bug in uml, we forgot to call the destructor.
> While we are here, give x a sane name.
> 
> Reported-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Co-developed-by: Matthew Wilcox <willy@infradead.org>

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

> Signed-off-by: Richard Weinberger <richard@nod.at>

And as a bonus, $ grep PageTables /proc/meminfo 
PageTables:       128720 kB

gets more accurate!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb()
  2020-10-19 21:10 [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb() Richard Weinberger
  2020-10-20  1:51 ` Matthew Wilcox
@ 2020-10-23 14:47 ` Christopher Obbard
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Obbard @ 2020-10-23 14:47 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-um, linux-kernel, anton.ivanov

On Mon, Oct 19, 2020 at 11:10:49PM +0200, Richard Weinberger wrote:
> Commit b2b29d6d0119 ("mm: account PMD tables like PTE tables") uncovered
> a bug in uml, we forgot to call the destructor.
> While we are here, give x a sane name.
> 
> Reported-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Co-developed-by: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Richard Weinberger <richard@nod.at>

Tested-by: Christopher Obbard <chris.obbard@collabora.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-23 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 21:10 [PATCH] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb() Richard Weinberger
2020-10-20  1:51 ` Matthew Wilcox
2020-10-23 14:47 ` Christopher Obbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).