Skip to contentSkip to conversation

x86-mm-clean-up-inconsistencies-when-flushing-tlb-ranges.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 28, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Subject: [merged] x86-mm-clean-up-inconsistencies-when-flushing-tlb-ranges.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 28 Jan 2014 11:10:07 -0800

The patch titled
Subject: x86: mm: clean up inconsistencies when flushing TLB ranges
has been removed from the -mm tree. Its filename was
x86-mm-clean-up-inconsistencies-when-flushing-tlb-ranges.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Mel Gorman <[email protected]>
Subject: x86: mm: clean up inconsistencies when flushing TLB ranges

NR_TLB_LOCAL_FLUSH_ALL is not always accounted for correctly and the comparison with total_vm is done before taking tlb_flushall_shift into account. Clean it up.

---

 arch/x86/mm/tlb.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/mm/tlb.c renamed from arch/x86/mm/tlb.c~x86-mm-clean-up-inconsistencies-when-flushing-tlb-ranges +6 -6
diff -puN arch/x86/mm/tlb.c~x86-mm-clean-up-inconsistencies-when-flushing-tlb-ranges arch/x86/mm/tlb.c
@@ -189,6 +189,7 @@ void flush_tlb_mm_range(struct mm_struct
 {
 	unsigned long addr;
 	unsigned act_entries, tlb_entries = 0;
+	unsigned long nr_base_pages;
 
 	preempt_disable();
 	if (current->active_mm != mm)
@@ -210,18 +211,17 @@ void flush_tlb_mm_range(struct mm_struct
 		tlb_entries = tlb_lli_4k[ENTRIES];
 	else
 		tlb_entries = tlb_lld_4k[ENTRIES];
+
 	/* Assume all of TLB entries was occupied by this task */
-	act_entries = mm->total_vm > tlb_entries ? tlb_entries : mm->total_vm;
+	act_entries = tlb_entries >> tlb_flushall_shift;
+	act_entries = mm->total_vm > act_entries ? act_entries : mm->total_vm;
+	nr_base_pages = (end - start) >> PAGE_SHIFT;
 
 	/* tlb_flushall_shift is on balance point, details in commit log */
-	if ((end - start) >> PAGE_SHIFT > act_entries >> tlb_flushall_shift) {
+	if (nr_base_pages > act_entries || has_large_page(mm, start, end)) {
 		count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
 		local_flush_tlb();
 	} else {
-		if (has_large_page(mm, start, end)) {
-			local_flush_tlb();
-			goto flush_all;
-		}
 		/* flush range by one by one 'invlpg' */
 		for (addr = start; addr < end;	addr += PAGE_SIZE) {
 			count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE);

_

Patches currently in -mm which might be from [email protected] are

origin.patch
mm-remove-bug_on-from-mlock_vma_page.patch mm-page-writebackc-fix-dirty_balance_reserve-subtraction-from-dirtyable-memory.patch mm-page-writebackc-do-not-count-anon-pages-as-dirtyable-memory.patch mm-numa-initialse-numa-balancing-after-jump-label-initialisation.patch mm-mempolicyc-convert-to-pr_foo.patch mm-page_alloc-allow-__gfp_nofail-to-allocate-below-watermarks-after-reclaim.patch mm-vmscan-respect-numa-policy-mask-when-shrinking-slab-on-direct-reclaim.patch mm-vmscan-move-call-to-shrink_slab-to-shrink_zones.patch mm-vmscan-remove-shrink_control-arg-from-do_try_to_free_pages.patch mm-compaction-ignore-pageblock-skip-when-manually-invoking-compaction.patch linux-next.patch
zsmalloc-move-it-under-mm.patch
zram-promote-zram-from-staging.patch