mm: vmstat: use a single setter function and callback for adjusting percpu thresholds
commit776be4763c7ece9b738c5a61bec68bc05b1b2d1c
authorMel Gorman <mel@csn.ul.ie>
Thu, 13 Jan 2011 23:45:43 +0000 (13 15:45 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 23:05:21 +0000 (7 15:05 -0800)
treee7a56436ebd890216a341c8b5cc3eed5932c2361
parent176111faba2c5785d40b4737908b855de75f026c
mm: vmstat: use a single setter function and callback for adjusting percpu thresholds

commit b44129b30652c8771db2265939bb8b463724043d upstream.

reduce_pgdat_percpu_threshold() and restore_pgdat_percpu_threshold() exist
to adjust the per-cpu vmstat thresholds while kswapd is awake to avoid
errors due to counter drift.  The functions duplicate some code so this
patch replaces them with a single set_pgdat_percpu_threshold() that takes
a callback function to calculate the desired threshold as a parameter.

[akpm@linux-foundation.org: readability tweak]
[kosaki.motohiro@jp.fujitsu.com: set_pgdat_percpu_threshold(): don't use for_each_online_cpu]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Christoph Lameter <cl@linux.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/vmstat.h
mm/vmscan.c
mm/vmstat.c