Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628445 > unrolled thread

[PATCH v2 0/3] x86/mm: Straightforward TLB flush fixes/cleanups

Started byAndy Lutomirski <luto@kernel.org>
First post2017-04-21 20:30 +0200
Last post2017-04-22 00:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/3] x86/mm: Straightforward TLB flush fixes/cleanups Andy Lutomirski <luto@kernel.org> - 2017-04-21 20:30 +0200
    [PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task() Andy Lutomirski <luto@kernel.org> - 2017-04-21 20:40 +0200
      Re: [PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task() Andy Lutomirski <luto@amacapital.net> - 2017-04-22 00:10 +0200

#1628445 — [PATCH v2 0/3] x86/mm: Straightforward TLB flush fixes/cleanups

FromAndy Lutomirski <luto@kernel.org>
Date2017-04-21 20:30 +0200
Subject[PATCH v2 0/3] x86/mm: Straightforward TLB flush fixes/cleanups
Message-ID<tyLtE-Ix-27@gated-at.bofh.it>
I have some less straightforward cleanups coming, but these three
are easy and might even be okay for 4.12 assuming that someone feels
like reviewing them.

Changes from v1:
 - Fixed the Cc list on patch 3.  No code changes at all.

Andy Lutomirski (3):
  x86/mm: Remove flush_tlb() and flush_tlb_current_task()
  x86/mm: Make flush_tlb_mm_range() more predictable
  x86/mm: Fix flush_tlb_page() on Xen

 arch/x86/include/asm/tlbflush.h |  3 ---
 arch/x86/mm/tlb.c               | 33 ++++++++-------------------------
 2 files changed, 8 insertions(+), 28 deletions(-)

-- 
2.9.3

[toc] | [next] | [standalone]


#1628470 — [PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task()

FromAndy Lutomirski <luto@kernel.org>
Date2017-04-21 20:40 +0200
Subject[PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task()
Message-ID<tyLDl-LM-61@gated-at.bofh.it>
In reply to#1628445
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.  In fact, it doesn't even exist on
!SMP builds.

Cc: Rik van Riel <riel@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/include/asm/tlbflush.h |  3 ---
 arch/x86/mm/tlb.c               | 17 -----------------
 2 files changed, 20 deletions(-)

diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index fc5abff9b7fd..cc7ea9a7d0c1 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -303,14 +303,11 @@ static inline void flush_tlb_kernel_range(unsigned long start,
 		flush_tlb_mm_range(vma->vm_mm, start, end, vma->vm_flags)
 
 extern void flush_tlb_all(void);
-extern void flush_tlb_current_task(void);
 extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
 extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 				unsigned long end, unsigned long vmflag);
 extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
 
-#define flush_tlb()	flush_tlb_current_task()
-
 void native_flush_tlb_others(const struct cpumask *cpumask,
 				struct mm_struct *mm,
 				unsigned long start, unsigned long end);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index a7655f6caf7d..92ec37f517ab 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -289,23 +289,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
 	smp_call_function_many(cpumask, flush_tlb_func, &info, 1);
 }
 
-void flush_tlb_current_task(void)
-{
-	struct mm_struct *mm = current->mm;
-
-	preempt_disable();
-
-	count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
-
-	/* This is an implicit full barrier that synchronizes with switch_mm. */
-	local_flush_tlb();
-
-	trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
-	if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
-		flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL);
-	preempt_enable();
-}
-
 /*
  * See Documentation/x86/tlb.txt for details.  We choose 33
  * because it is large enough to cover the vast majority (at
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1628638 — Re: [PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task()

FromAndy Lutomirski <luto@amacapital.net>
Date2017-04-22 00:10 +0200
SubjectRe: [PATCH v2 1/3] x86/mm: Remove flush_tlb() and flush_tlb_current_task()
Message-ID<tyOUx-2RV-5@gated-at.bofh.it>
In reply to#1628470
On Fri, Apr 21, 2017 at 11:15 AM, Andy Lutomirski <luto@kernel.org> wrote:
> 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.  In fact, it doesn't even exist on
> !SMP builds.

Please disregard this patch for now.  It has issues.

---Andy

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web