+ vmstat-create-fold_diff.patch added to -mm tree
Subsystems (2)
[email protected]
maintainerSubject: + vmstat-create-fold_diff.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 07 Aug 2013 13:43:08 -0700
The patch titled
Subject: vmstat: create fold_diff
has been added to the -mm tree. Its filename is
vmstat-create-fold_diff.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/vmstat-create-fold_diff.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/vmstat-create-fold_diff.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Christoph Lameter <[email protected]>
Subject: vmstat: create fold_diff
Both functions that update global counters use the same mechanism.
Create a function that contains the common code.
---
mm/vmstat.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
mm/vmstat.c renamed from mm/vmstat.c~vmstat-create-fold_diff +11 -7
@@ -414,6 +414,15 @@ void dec_zone_page_state(struct page *paEXPORT_SYMBOL (dec_zone_page_state);#endif +static inline void fold_diff (int *diff) +{ +int i; + +for (i =0 ; i <NR_VM_ZONE_STAT_ITEMS ; i++) +if (diff[i]) +atomic_long_add (diff[i], &vm_stat[i]); +} +/* * Update the zone counters for the current cpu. *
@@ -483,10 +492,7 @@ static void refresh_cpu_vm_stats(int cpudrain_zone_pages (zone, &p->pcp);#endif } - -for (i =0 ; i <NR_VM_ZONE_STAT_ITEMS ; i++) -if (global_diff[i]) -atomic_long_add (global_diff[i], &vm_stat[i]); +fold_diff (global_diff); }/*
@@ -516,9 +522,7 @@ void cpu_vm_stats_fold(int cpu) } } -for (i =0 ; i <NR_VM_ZONE_STAT_ITEMS ; i++) -if (global_diff[i]) -atomic_long_add (global_diff[i], &vm_stat[i]); +fold_diff (global_diff); }/*
_
Patches currently in -mm which might be from [email protected] are
vmstat-create-separate-function-to-fold-per-cpu-diffs-into-local-counters.patch vmstat-create-fold_diff.patch vmstat-use-this_cpu-to-avoid-irqon-off-sequence-in-refresh_cpu_vm_stats.patch linux-next.patch