Skip to content

Commit 1e56a56

Browse files
Peter Zijlstratorvalds
authored andcommitted
sh: mmu_gather rework
Fix up the sh mmu_gather code to conform to the new API. Signed-off-by: Peter Zijlstra <[email protected]> Acked-by: Paul Mundt <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: David Miller <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Russell King <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Tony Luck <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Mel Gorman <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Namhyung Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9e14f67 commit 1e56a56

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

arch/sh/include/asm/tlb.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ struct mmu_gather {
2323
unsigned long start, end;
2424
};
2525

26-
DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
27-
2826
static inline void init_tlb_gather(struct mmu_gather *tlb)
2927
{
3028
tlb->start = TASK_SIZE;
@@ -36,17 +34,13 @@ static inline void init_tlb_gather(struct mmu_gather *tlb)
3634
}
3735
}
3836

39-
static inline struct mmu_gather *
40-
tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
37+
static inline void
38+
tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned int full_mm_flush)
4139
{
42-
struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
43-
4440
tlb->mm = mm;
4541
tlb->fullmm = full_mm_flush;
4642

4743
init_tlb_gather(tlb);
48-
49-
return tlb;
5044
}
5145

5246
static inline void
@@ -57,8 +51,6 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
5751

5852
/* keep the page table cache within bounds */
5953
check_pgt_cache();
60-
61-
put_cpu_var(mmu_gathers);
6254
}
6355

6456
static inline void
@@ -91,7 +83,21 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
9183
}
9284
}
9385

94-
#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
86+
static inline void tlb_flush_mmu(struct mmu_gather *tlb)
87+
{
88+
}
89+
90+
static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
91+
{
92+
free_page_and_swap_cache(page);
93+
return 1; /* avoid calling tlb_flush_mmu */
94+
}
95+
96+
static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
97+
{
98+
__tlb_remove_page(tlb, page);
99+
}
100+
95101
#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
96102
#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
97103
#define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp)

0 commit comments

Comments
 (0)