Thread (52 messages) flat view 52 messages, 6 authors, 2011-05-27

[PATCH 20/19] ARM: LPAE: Invalidate the TLB before freeing the PMD

From: Russell King - ARM Linux <hidden>
Date: 2011-05-11 15:40:14
Also in: lkml

On Wed, May 11, 2011 at 11:23:19AM +0100, Catalin Marinas wrote:
+static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
+				  unsigned long addr)
+{
+#ifdef CONFIG_ARM_LPAE
+	tlb_add_flush(tlb, addr);
+	tlb_flush(tlb);
+	pmd_free((tlb)->mm, pmdp);
+#endif
+}
You're:

1. tlb_add_flush() - Adding the address which covers the PMD to the range
   of virtual addresses which need flushing - ok.
2. tlb_flush() - You're then forcing a flush.
3. pmd_free() - You're now freeing the page.

One of the points about the shootdown interface is that it batches things
up.  So what's wrong with:

static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
	unsigned long addr)
{
#ifdef CONFIG_ARM_LPAE
	tlb_add_flush(tlb, addr);
	tlb_remove_page(tlb, virt_to_page(pmdp));
#endif
}

and leave the tlb invalidate and actual page freeing to the batching code
to deal with?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help