Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83086
b: refs/heads/master
c: a7f75e2
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 5, 2008
1 parent a08195b commit 75f7a0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08e7d9b557299ba6ce57165ce8df310780bd681c
refs/heads/master: a7f75e25860ac0a7b70cf6e14c37618d2d2bb890
20 changes: 16 additions & 4 deletions trunk/mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ EXPORT_SYMBOL(dec_zone_page_state);
/*
* Update the zone counters for one cpu.
*
* The cpu specified must be either the current cpu or a processor that
* is not online. If it is the current cpu then the execution thread must
* be pinned to the current cpu.
*
* Note that refresh_cpu_vm_stats strives to only access
* node local memory. The per cpu pagesets on remote zones are placed
* in the memory local to the processor using that pageset. So the
Expand All @@ -299,7 +303,7 @@ void refresh_cpu_vm_stats(int cpu)
{
struct zone *zone;
int i;
unsigned long flags;
int global_diff[NR_VM_ZONE_STAT_ITEMS] = { 0, };

for_each_zone(zone) {
struct per_cpu_pageset *p;
Expand All @@ -311,15 +315,19 @@ void refresh_cpu_vm_stats(int cpu)

for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
if (p->vm_stat_diff[i]) {
unsigned long flags;
int v;

local_irq_save(flags);
zone_page_state_add(p->vm_stat_diff[i],
zone, i);
v = p->vm_stat_diff[i];
p->vm_stat_diff[i] = 0;
local_irq_restore(flags);
atomic_long_add(v, &zone->vm_stat[i]);
global_diff[i] += v;
#ifdef CONFIG_NUMA
/* 3 seconds idle till flush */
p->expire = 3;
#endif
local_irq_restore(flags);
}
#ifdef CONFIG_NUMA
/*
Expand Down Expand Up @@ -351,6 +359,10 @@ void refresh_cpu_vm_stats(int cpu)
drain_zone_pages(zone, p->pcp + 1);
#endif
}

for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
if (global_diff[i])
atomic_long_add(global_diff[i], &vm_stat[i]);
}

#endif
Expand Down

0 comments on commit 75f7a0a

Please sign in to comment.