Skip to content

Commit 29961b5

Browse files
amlutoIngo Molnar
authored andcommitted
x86/mm: Remove flush_tlb() and flush_tlb_current_task()
I was trying to figure out what how flush_tlb_current_task() would possibly work correctly if current->mm != current->active_mm, but I realized I could spare myself the effort: it has no callers except the unused flush_tlb() macro. Signed-off-by: Andy Lutomirski <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Nadav Amit <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/e52d64c11690f85e9f1d69d7b48cc2269cd2e94b.1492844372.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent 9ccee23 commit 29961b5

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

arch/x86/include/asm/tlbflush.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ static inline void __flush_tlb_one(unsigned long addr)
215215
/*
216216
* TLB flushing:
217217
*
218-
* - flush_tlb() flushes the current mm struct TLBs
219218
* - flush_tlb_all() flushes all processes TLBs
220219
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
221220
* - flush_tlb_page(vma, vmaddr) flushes one page
@@ -247,11 +246,6 @@ static inline void flush_tlb_all(void)
247246
__flush_tlb_all();
248247
}
249248

250-
static inline void flush_tlb(void)
251-
{
252-
__flush_tlb_up();
253-
}
254-
255249
static inline void local_flush_tlb(void)
256250
{
257251
__flush_tlb_up();
@@ -313,14 +307,11 @@ static inline void flush_tlb_kernel_range(unsigned long start,
313307
flush_tlb_mm_range(vma->vm_mm, start, end, vma->vm_flags)
314308

315309
extern void flush_tlb_all(void);
316-
extern void flush_tlb_current_task(void);
317310
extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
318311
extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
319312
unsigned long end, unsigned long vmflag);
320313
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
321314

322-
#define flush_tlb() flush_tlb_current_task()
323-
324315
void native_flush_tlb_others(const struct cpumask *cpumask,
325316
struct mm_struct *mm,
326317
unsigned long start, unsigned long end);

arch/x86/mm/tlb.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -289,23 +289,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
289289
smp_call_function_many(cpumask, flush_tlb_func, &info, 1);
290290
}
291291

292-
void flush_tlb_current_task(void)
293-
{
294-
struct mm_struct *mm = current->mm;
295-
296-
preempt_disable();
297-
298-
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
299-
300-
/* This is an implicit full barrier that synchronizes with switch_mm. */
301-
local_flush_tlb();
302-
303-
trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
304-
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
305-
flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL);
306-
preempt_enable();
307-
}
308-
309292
/*
310293
* See Documentation/x86/tlb.txt for details. We choose 33
311294
* because it is large enough to cover the vast majority (at

0 commit comments

Comments
 (0)