Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: mmu_gather rework

Fix up the um mmu_gather code to conform to the new API.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Miller <davem@davemloft.net>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Zijlstra and committed by
Linus Torvalds
ff075d60 7a95a2c8

+11 -18
+11 -18
arch/um/include/asm/tlb.h
··· 22 22 unsigned int fullmm; /* non-zero means full mm flush */ 23 23 }; 24 24 25 - /* Users of the generic TLB shootdown code must declare this storage space. */ 26 - DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 27 - 28 25 static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, 29 26 unsigned long address) 30 27 { ··· 44 47 } 45 48 } 46 49 47 - /* tlb_gather_mmu 48 - * Return a pointer to an initialized struct mmu_gather. 49 - */ 50 - static inline struct mmu_gather * 51 - tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 50 + static inline void 51 + tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned int full_mm_flush) 52 52 { 53 - struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); 54 - 55 53 tlb->mm = mm; 56 54 tlb->fullmm = full_mm_flush; 57 55 58 56 init_tlb_gather(tlb); 59 - 60 - return tlb; 61 57 } 62 58 63 59 extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, 64 60 unsigned long end); 65 61 66 62 static inline void 67 - tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 63 + tlb_flush_mmu(struct mmu_gather *tlb) 68 64 { 69 65 if (!tlb->need_flush) 70 66 return; ··· 73 83 static inline void 74 84 tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 75 85 { 76 - tlb_flush_mmu(tlb, start, end); 86 + tlb_flush_mmu(tlb); 77 87 78 88 /* keep the page table cache within bounds */ 79 89 check_pgt_cache(); 80 - 81 - put_cpu_var(mmu_gathers); 82 90 } 83 91 84 92 /* tlb_remove_page ··· 84 96 * while handling the additional races in SMP caused by other CPUs 85 97 * caching valid mappings in their TLBs. 86 98 */ 87 - static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) 99 + static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) 88 100 { 89 101 tlb->need_flush = 1; 90 102 free_page_and_swap_cache(page); 91 - return; 103 + return 1; /* avoid calling tlb_flush_mmu */ 104 + } 105 + 106 + static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) 107 + { 108 + __tlb_remove_page(tlb, page); 92 109 } 93 110 94 111 /**