projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CGroup API files: use cgroup map for memcontrol stats file
[deliverable/linux.git]
/
mm
/
vmstat.c
diff --git
a/mm/vmstat.c
b/mm/vmstat.c
index e8d846f57774ee631adc5836aeaa6498b39736a0..ec6035eda933f463ceaa849e8f9f96663a2a025f 100644
(file)
--- a/
mm/vmstat.c
+++ b/
mm/vmstat.c
@@
-21,21
+21,14
@@
EXPORT_PER_CPU_SYMBOL(vm_event_states);
static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
{
static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
{
- int cpu
= 0
;
+ int cpu;
int i;
memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
int i;
memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
- cpu = first_cpu(*cpumask);
- while (cpu < NR_CPUS) {
+ for_each_cpu_mask(cpu, *cpumask) {
struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
- cpu = next_cpu(cpu, *cpumask);
-
- if (cpu < NR_CPUS)
- prefetch(&per_cpu(vm_event_states, cpu));
-
-
for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
ret[i] += this->event[i];
}
for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
ret[i] += this->event[i];
}
@@
-284,6
+277,10
@@
EXPORT_SYMBOL(dec_zone_page_state);
/*
* Update the zone counters for one cpu.
*
/*
* 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
* 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
@@
-299,7
+296,7
@@
void refresh_cpu_vm_stats(int cpu)
{
struct zone *zone;
int i;
{
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;
for_each_zone(zone) {
struct per_cpu_pageset *p;
@@
-311,16
+308,21
@@
void refresh_cpu_vm_stats(int cpu)
for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
if (p->vm_stat_diff[i]) {
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);
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;
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
#ifdef CONFIG_NUMA
/* 3 seconds idle till flush */
p->expire = 3;
#endif
- local_irq_restore(flags);
}
}
+ cond_resched();
#ifdef CONFIG_NUMA
/*
* Deal with draining the remote pageset of this
#ifdef CONFIG_NUMA
/*
* Deal with draining the remote pageset of this
@@
-329,7
+331,7
@@
void refresh_cpu_vm_stats(int cpu)
* Check if there are pages remaining in this pageset
* if not then there is nothing to expire.
*/
* Check if there are pages remaining in this pageset
* if not then there is nothing to expire.
*/
- if (!p->expire ||
(!p->pcp[0].count && !p->pcp[1].count)
)
+ if (!p->expire ||
!p->pcp.count
)
continue;
/*
continue;
/*
@@
-344,13
+346,14
@@
void refresh_cpu_vm_stats(int cpu)
if (p->expire)
continue;
if (p->expire)
continue;
- if (p->pcp[0].count)
- drain_zone_pages(zone, p->pcp + 0);
-
- if (p->pcp[1].count)
- drain_zone_pages(zone, p->pcp + 1);
+ if (p->pcp.count)
+ drain_zone_pages(zone, &p->pcp);
#endif
}
#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
}
#endif
@@
-362,13
+365,13
@@
void refresh_cpu_vm_stats(int cpu)
*
* Must be called with interrupts disabled.
*/
*
* Must be called with interrupts disabled.
*/
-void zone_statistics(struct zone
list *zonelist
, struct zone *z)
+void zone_statistics(struct zone
*preferred_zone
, struct zone *z)
{
{
- if (z->zone_pgdat ==
zonelist->zones[0]
->zone_pgdat) {
+ if (z->zone_pgdat ==
preferred_zone
->zone_pgdat) {
__inc_zone_state(z, NUMA_HIT);
} else {
__inc_zone_state(z, NUMA_MISS);
__inc_zone_state(z, NUMA_HIT);
} else {
__inc_zone_state(z, NUMA_MISS);
- __inc_zone_state(
zonelist->zones[0]
, NUMA_FOREIGN);
+ __inc_zone_state(
preferred_zone
, NUMA_FOREIGN);
}
if (z->node == numa_node_id())
__inc_zone_state(z, NUMA_LOCAL);
}
if (z->node == numa_node_id())
__inc_zone_state(z, NUMA_LOCAL);
@@
-386,6
+389,7
@@
static char * const migratetype_names[MIGRATE_TYPES] = {
"Reclaimable",
"Movable",
"Reserve",
"Reclaimable",
"Movable",
"Reserve",
+ "Isolate",
};
static void *frag_start(struct seq_file *m, loff_t *pos)
};
static void *frag_start(struct seq_file *m, loff_t *pos)
@@
-642,6
+646,10
@@
static const char * const vmstat_text[] = {
"allocstall",
"pgrotated",
"allocstall",
"pgrotated",
+#ifdef CONFIG_HUGETLB_PAGE
+ "htlb_buddy_alloc_success",
+ "htlb_buddy_alloc_fail",
+#endif
#endif
};
#endif
};
@@
-681,20
+689,17
@@
static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
"\n pagesets");
for_each_online_cpu(i) {
struct per_cpu_pageset *pageset;
"\n pagesets");
for_each_online_cpu(i) {
struct per_cpu_pageset *pageset;
- int j;
pageset = zone_pcp(zone, i);
pageset = zone_pcp(zone, i);
- for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
- seq_printf(m,
- "\n cpu: %i pcp: %i"
- "\n count: %i"
- "\n high: %i"
- "\n batch: %i",
- i, j,
- pageset->pcp[j].count,
- pageset->pcp[j].high,
- pageset->pcp[j].batch);
- }
+ seq_printf(m,
+ "\n cpu: %i"
+ "\n count: %i"
+ "\n high: %i"
+ "\n batch: %i",
+ i,
+ pageset->pcp.count,
+ pageset->pcp.high,
+ pageset->pcp.batch);
#ifdef CONFIG_SMP
seq_printf(m, "\n vm stats threshold: %d",
pageset->stat_threshold);
#ifdef CONFIG_SMP
seq_printf(m, "\n vm stats threshold: %d",
pageset->stat_threshold);
This page took
0.027013 seconds
and
5
git commands to generate.