All of lore.kernel.org
 help / color / mirror / Atom feed
* sparc64: Reduce TLB flushes on hugetlb PTE change
@ 2016-03-08  2:23 Nitin Gupta
  2016-03-08  4:32 ` David Miller
  2016-03-08 14:56 ` Nitin Gupta
  0 siblings, 2 replies; 3+ messages in thread
From: Nitin Gupta @ 2016-03-08  2:23 UTC (permalink / raw)
  To: sparclinux

Flush TSB and TLB only at REAL_HPAGE_SIZE boundaries and
not at every 8K stride.

Orabug: 22643230

Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
---
 arch/sparc/mm/hugetlbpage.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index d8f625c..0f4f320 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -182,11 +182,17 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 
 	addr &= HPAGE_MASK;
 	for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
-		set_pte_at(mm, addr, ptep, entry);
+		*ptep = entry;
 		ptep++;
 		addr += PAGE_SIZE;
 		pte_val(entry) += PAGE_SIZE;
 	}
+
+	/* Issue TSB and TLB flush at REAL_HPAGE_SIZE boundaries */
+	flush_tsb_user_page(mm, addr, true);
+	flush_tsb_user_page(mm, addr + REAL_HPAGE_SIZE, true);
+	global_flush_tlb_page(mm, addr);
+	global_flush_tlb_page(mm, addr + REAL_HPAGE_SIZE);
 }
 
 pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
-- 
2.6.4


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

end of thread, other threads:[~2016-03-08 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08  2:23 sparc64: Reduce TLB flushes on hugetlb PTE change Nitin Gupta
2016-03-08  4:32 ` David Miller
2016-03-08 14:56 ` Nitin Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.