linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC][Qusetion] the value of cleared_(ptes|pmds|puds|p4ds) in struct mmu_gather
@ 2020-03-28  4:30 Zhenyu Ye
  2020-03-30 12:16 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenyu Ye @ 2020-03-28  4:30 UTC (permalink / raw)
  To: Peter Zijlstra, npiggin, will.deacon, mingo, torvalds,
	schwidefsky, akpm, luto, bp, Marc Zyngier
  Cc: linux-arch, yezhenyu2, linux-kernel, xiexiangyou, arm,
	linux-arm-kernel

Hi all,

commit a6d60245 "Track which levels of the page tables have been cleared"
added cleared_(ptes|pmds|puds|p4ds) in struct mmu_gather, and the values
of them are set in some places. For example:

In include/asm-generic/tlb.h, pte_free_tlb() set the tlb->cleared_pmds:
---8<---
#ifndef pte_free_tlb
#define pte_free_tlb(tlb, ptep, address)			\
	do {							\
		__tlb_adjust_range(tlb, address, PAGE_SIZE);	\
		tlb->freed_tables = 1;				\
		tlb->cleared_pmds = 1;				\
		__pte_free_tlb(tlb, ptep, address);		\
	} while (0)
#endif
---8<---


However, in arch/s390/include/asm/tlb.h, pte_free_tlb() set the tlb->cleared_ptes:
---8<---
static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
                                unsigned long address)
{
	__tlb_adjust_range(tlb, address, PAGE_SIZE);
	tlb->mm->context.flush_mm = 1;
	tlb->freed_tables = 1;
	tlb->cleared_ptes = 1;
	/*
	 * page_table_free_rcu takes care of the allocation bit masks
	 * of the 2K table fragments in the 4K page table page,
	 * then calls tlb_remove_table.
	 */
	page_table_free_rcu(tlb, (unsigned long *) pte, address);
}
---8<---


In my view, the cleared_(ptes|pmds|puds) and (pte|pmd|pud)_free_tlb
correspond one-to-one.  So we should set cleared_ptes in pte_free_tlb(),
then use it when needed.

I'm very confused about this. Which is wrong? Or is there something
I understand wrong?


Thanks,
Zhenyu



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-04-20 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-28  4:30 [RFC][Qusetion] the value of cleared_(ptes|pmds|puds|p4ds) in struct mmu_gather Zhenyu Ye
2020-03-30 12:16 ` Peter Zijlstra
2020-03-31  8:15   ` Zhenyu Ye
2020-04-08  8:51   ` Christian Borntraeger
2020-04-20 16:20     ` Gerald Schaefer
2020-04-14  7:05   ` Christian Borntraeger

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).