mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] mm, sparc64: Implement gup_fast()
@ 2011-07-12 12:26 Peter Zijlstra
  2011-07-12 12:26 ` [PATCH 1/4] sparc64: Kill page table quicklists Peter Zijlstra
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Peter Zijlstra @ 2011-07-12 12:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-MM, LKML, David Miller, Peter Zijlstra

With the recent mmu_gather changes that included generic RCU freeing of
page-tables, it is now quite straight forward to implement gup_fast() on
sparc64.

Andrew, please consider merging these patches.

Thanks.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 2/4] sparc64: Use RCU page table freeing.
@ 2010-04-09  1:00 David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-04-09  1:00 UTC (permalink / raw)
  To: a.p.zijlstra
  Cc: aarcange, avi, tglx, riel, mingo, akpm, torvalds, linux-kernel,
	linux-arch, benh, hugh.dickins, mel, npiggin


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/pgalloc_64.h |   49 +++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/include/asm/pgalloc_64.h b/arch/sparc/include/asm/pgalloc_64.h
index cb4867d..f2df91e 100644
--- a/arch/sparc/include/asm/pgalloc_64.h
+++ b/arch/sparc/include/asm/pgalloc_64.h
@@ -76,7 +76,52 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
 
 #define check_pgt_cache()	do { } while (0)
 
-#define __pte_free_tlb(tlb, pte, addr)	pte_free((tlb)->mm, pte)
-#define __pmd_free_tlb(tlb, pmd, addr)	pmd_free((tlb)->mm, pmd)
+static inline void pgtable_free(void *table, bool is_page)
+{
+	if (is_page)
+		free_page((unsigned long)table);
+	else
+		kmem_cache_free(pgtable_cache, table);
+}
+
+#ifdef CONFIG_SMP
+#define HAVE_ARCH_RCU_TABLE_FREE
+
+struct mmu_gather;
+extern void tlb_remove_table(struct mmu_gather *, void *);
+
+static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, bool is_page)
+{
+	unsigned long pgf = (unsigned long)table;
+	if (is_page)
+		pgf |= 0x1UL;
+	tlb_remove_table(tlb, (void *)pgf);
+}
+
+static inline void __tlb_remove_table(void *_table)
+{
+	void *table = (void *)((unsigned long)_table & ~0x1UL);
+	bool is_page = false;
+
+	if ((unsigned long)_table & 0x1UL)
+		is_page = true;
+	pgtable_free(table, is_page);
+}
+#else /* CONFIG_SMP */
+static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, bool is_page)
+{
+	pgtable_free(table, is_page);
+}
+#endif /* !CONFIG_SMP */
+
+static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage,
+				  unsigned long address)
+{
+	pgtable_page_dtor(ptepage);
+	pgtable_free_tlb(tlb, page_address(ptepage), true);
+}
+
+#define __pmd_free_tlb(tlb, pmd, addr)		      \
+	pgtable_free_tlb(tlb, pmd, false)
 
 #endif /* _SPARC64_PGALLOC_H */
-- 
1.6.6.1


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

end of thread, other threads:[~2011-07-15 16:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 12:26 [PATCH 0/4] mm, sparc64: Implement gup_fast() Peter Zijlstra
2011-07-12 12:26 ` [PATCH 1/4] sparc64: Kill page table quicklists Peter Zijlstra
2011-07-13 22:31   ` Andrew Morton
2011-07-12 12:26 ` [PATCH 2/4] sparc64: Use RCU page table freeing Peter Zijlstra
2011-07-12 12:26 ` [PATCH 3/4] sparc64: Add support for _PAGE_SPECIAL Peter Zijlstra
2011-07-12 12:26 ` [PATCH 4/4] sparc64: Implement get_user_pages_fast() Peter Zijlstra
2011-07-12 12:42 ` [PATCH 0/4] mm, sparc64: Implement gup_fast() Peter Zijlstra
2011-07-13 22:33   ` Andrew Morton
2011-07-15 16:21     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2010-04-09  1:00 [PATCH 2/4] sparc64: Use RCU page table freeing David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®