Thread (38 messages) 38 messages, 10 authors, 2012-05-21

Re: [RFC][PATCH 4/6] arm, mm: Convert arm to generic tlb

From: Peter Zijlstra <hidden>
Date: 2011-03-09 15:40:01
Also in: linux-arch, lkml

On Wed, 2011-03-09 at 15:36 +0000, Catalin Marinas wrote:
On Wed, 2011-03-09 at 15:19 +0000, Peter Zijlstra wrote:
quoted
On Wed, 2011-03-09 at 15:16 +0000, Catalin Marinas wrote:
quoted
Hi Peter,

On 2 March 2011 17:59, Peter Zijlstra [off-list ref] wrote:
quoted
--- linux-2.6.orig/arch/arm/include/asm/tlb.h
+++ linux-2.6/arch/arm/include/asm/tlb.h
[...]
quoted
+__pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
 {
       pgtable_page_dtor(pte);
-       tlb_add_flush(tlb, addr);
       tlb_remove_page(tlb, pte);
 }
I think we still need a tlb_track_range() call here. On the path to
pte_free_tlb() (for example shift_arg_pages ... free_pte_range) there
doesn't seem to be any code setting the tlb->start/end range. Did I
miss anything?
Patch 3 included:

-#define pte_free_tlb(tlb, ptep, address)                       \
-       do {                                                    \
-               tlb->need_flush = 1;                            \
-               __pte_free_tlb(tlb, ptep, address);             \
+#define pte_free_tlb(tlb, ptep, address)                                       \
+       do {                                                                    \
+               tlb->need_flush = 1;                                            \
+               tlb_track_range(tlb, address, pmd_addr_end(address, TASK_SIZE));\
+               __pte_free_tlb(tlb, ptep, address);                             \
        } while (0)
OK, so the range is tracked. The only issue is that for platforms with a
folded pmd the range end would go to TASK_SIZE. In this case
pgd_addr_end() would make more sense (or something like
PTRS_PER_PTE*PAGE_SIZE).
Urgh, so when pmds are folded pmd_addr_end() doesn't get to be the next
biggest thing?  PTRS_PER_PTE*PAGE_SIZE like things don't work since
there is no guarantee addr is at the beginning of the pmd.

Ok, will try and sort that out.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help