lkml.org 
[lkml]   [2018]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 10/11] x86,tlb: really leave mm on shootdown
Date
When getting an mm shot down from under us in lazy TLB mode, don't
just switch the TLB over to the init_mm page tables, but really drop
our references to the lazy TLB mm.

This allows for faster (instant) freeing of a lazy TLB mm, which is
a precondition to getting rid of the refcounting of mms in lazy TLB mode.

Signed-off-by: Rik van Riel <riel@surriel.com>
---
arch/x86/mm/tlb.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 7b1add904396..425cb9fa2640 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -140,6 +140,8 @@ void leave_mm(void *dummy)
WARN_ON(!this_cpu_read(cpu_tlbstate.is_lazy));

switch_mm(NULL, &init_mm, NULL);
+ current->active_mm = &init_mm;
+ mmdrop(loaded_mm);
}
EXPORT_SYMBOL_GPL(leave_mm);

@@ -483,6 +485,8 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f,
* IPIs to lazy TLB mode CPUs.
*/
switch_mm_irqs_off(NULL, &init_mm, NULL);
+ current->active_mm = &init_mm;
+ mmdrop(loaded_mm);
return;
}

--
2.14.4
\
 
 \ /
  Last update: 2018-08-01 12:04    [W:0.117 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site