lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] x86: mm: Account for the of CPUs that must be flushed during a TLB range flush
Date
X86 TLB range flushing uses a balance point to decide if a single global TLB
flush or multiple single page flushes would perform best. This patch takes into
account how many CPUs must be flushed.

Signed-off-by: Mel Gorman <mgorman@suse.de>
---
arch/x86/mm/tlb.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 09b8cb8..0cababa 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -217,6 +217,9 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
act_entries = mm->total_vm > act_entries ? act_entries : mm->total_vm;
nr_base_pages = (end - start) >> PAGE_SHIFT;

+ /* Take the number of CPUs to range flush into account */
+ nr_base_pages *= cpumask_weight(mm_cpumask(mm));
+
/* tlb_flushall_shift is on balance point, details in commit log */
if (nr_base_pages > act_entries || has_large_page(mm, start, end)) {
count_vm_event(NR_TLB_LOCAL_FLUSH_ALL);
--
1.8.4


\
 
 \ /
  Last update: 2013-12-12 13:01    [W:0.068 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site