Commit be4ffc0d authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Ingo Molnar

x86/mm: Be more consistent wrt PAGE_SHIFT vs PAGE_SIZE in tlb flush code

Nadav pointed out that some code used PAGE_SIZE and other code used
PAGE_SHIFT.  Use PAGE_SHIFT instead of multiplying or dividing by
PAGE_SIZE.
Requested-by: default avatarNadav Amit <nadav.amit@gmail.com>
Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3d28ebce
...@@ -220,8 +220,7 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f, ...@@ -220,8 +220,7 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f,
trace_tlb_flush(reason, TLB_FLUSH_ALL); trace_tlb_flush(reason, TLB_FLUSH_ALL);
} else { } else {
unsigned long addr; unsigned long addr;
unsigned long nr_pages = unsigned long nr_pages = (f->end - f->start) >> PAGE_SHIFT;
(f->end - f->start) / PAGE_SIZE;
addr = f->start; addr = f->start;
while (addr < f->end) { while (addr < f->end) {
__flush_tlb_single(addr); __flush_tlb_single(addr);
...@@ -351,7 +350,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end) ...@@ -351,7 +350,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
/* Balance as user space task's flush, a bit conservative */ /* Balance as user space task's flush, a bit conservative */
if (end == TLB_FLUSH_ALL || if (end == TLB_FLUSH_ALL ||
(end - start) > tlb_single_page_flush_ceiling * PAGE_SIZE) { (end - start) > tlb_single_page_flush_ceiling << PAGE_SHIFT) {
on_each_cpu(do_flush_tlb_all, NULL, 1); on_each_cpu(do_flush_tlb_all, NULL, 1);
} else { } else {
struct flush_tlb_info info; struct flush_tlb_info info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment