OSDN Git Service

x86/mm/pat: Improve scaling of pat_pagerange_is_ram()
authorJohn Dykstra <jdykstra@cray.com>
Fri, 25 May 2012 21:12:46 +0000 (16:12 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 30 May 2012 08:57:11 +0000 (10:57 +0200)
commitfa83523f45fbb403eba4ebc5704bf98aa4da0163
tree35466e5e2e9e5ed8171ef596d63690ed42621fca
parent1b38a3a10f2ad96a3c0130f63b7f3610bab7090d
x86/mm/pat: Improve scaling of pat_pagerange_is_ram()

Function pat_pagerange_is_ram() scales poorly to large address
ranges, because it probes the resource tree for each page.

On a 2.6 GHz Opteron, this function consumes 34 ms for a 1 GB range.

It is called twice during untrack_pfn_vma(), slowing process
cleanup and handicapping the OOM killer.

This replacement consumes less than 1ms, under the same conditions.

Signed-off-by: John Dykstra <jdykstra@cray.com> on behalf of Cray Inc.
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1337980366.1979.6.camel@redwood
[ Small stylistic cleanups and renames ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/mm/pat.c