mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
mm: introduce for_each_populated_zone() macro
Impact: cleanup In almost cases, for_each_zone() is used with populated_zone(). It's because almost function doesn't need memoryless node information. Therefore, for_each_populated_zone() can help to make code simplify. This patch has no functional change. [[email protected]: small cleanup] Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Mel Gorman <[email protected]> Reviewed-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a6dc60f897
commit
ee99c71c59
6 changed files with 27 additions and 48 deletions
11
mm/vmstat.c
11
mm/vmstat.c
|
|
@ -135,11 +135,7 @@ static void refresh_zone_stat_thresholds(void)
|
|||
int cpu;
|
||||
int threshold;
|
||||
|
||||
for_each_zone(zone) {
|
||||
|
||||
if (!zone->present_pages)
|
||||
continue;
|
||||
|
||||
for_each_populated_zone(zone) {
|
||||
threshold = calculate_threshold(zone);
|
||||
|
||||
for_each_online_cpu(cpu)
|
||||
|
|
@ -301,12 +297,9 @@ void refresh_cpu_vm_stats(int cpu)
|
|||
int i;
|
||||
int global_diff[NR_VM_ZONE_STAT_ITEMS] = { 0, };
|
||||
|
||||
for_each_zone(zone) {
|
||||
for_each_populated_zone(zone) {
|
||||
struct per_cpu_pageset *p;
|
||||
|
||||
if (!populated_zone(zone))
|
||||
continue;
|
||||
|
||||
p = zone_pcp(zone, cpu);
|
||||
|
||||
for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue