From 3dc8bc6e2e4e1a2ca5edcee208d1a22ae2c3c6ec Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 10 Feb 2007 01:44:41 -0800 Subject: [PATCH] --- yaml --- r: 47495 b: refs/heads/master c: 780a065668b1c6ca6a70c7d36b9f6552ea3bb5f5 h: refs/heads/master i: 47493: 04f8a01056c90fa2c8f08bbe63196609dacabec4 47491: b3bfbdab3e69ae362ab089389aa29cace19f8750 47487: 167bc3405500b9507579bd1e1c9638e5da06183b v: v3 --- [refs] | 2 +- trunk/include/linux/vmstat.h | 47 ++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 2e79945d08da..1226b8d4b3a0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7131b6d167b41593463ce98df17e101e776bf5ec +refs/heads/master: 780a065668b1c6ca6a70c7d36b9f6552ea3bb5f5 diff --git a/trunk/include/linux/vmstat.h b/trunk/include/linux/vmstat.h index 7ba91f2839fa..acb1f105870c 100644 --- a/trunk/include/linux/vmstat.h +++ b/trunk/include/linux/vmstat.h @@ -7,18 +7,6 @@ #include #include -#ifdef CONFIG_VM_EVENT_COUNTERS -/* - * Light weight per cpu counter implementation. - * - * Counters should only be incremented. You need to set EMBEDDED - * to disable VM_EVENT_COUNTERS. Things like procps (vmstat, - * top, etc) use /proc/vmstat and depend on these counters. - * - * Counters are handled completely inline. On many platforms the code - * generated will simply be the increment of a global address. - */ - #ifdef CONFIG_ZONE_DMA #define DMA_ZONE(xx) xx##_DMA, #else @@ -52,6 +40,17 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, NR_VM_EVENT_ITEMS }; +#ifdef CONFIG_VM_EVENT_COUNTERS +/* + * Light weight per cpu counter implementation. + * + * Counters should only be incremented and no critical kernel component + * should rely on the counter values. + * + * Counters are handled completely inline. On many platforms the code + * generated will simply be the increment of a global address. + */ + struct vm_event_state { unsigned long event[NR_VM_EVENT_ITEMS]; }; @@ -92,12 +91,24 @@ static inline void vm_events_fold_cpu(int cpu) #else /* Disable counters */ -#define get_cpu_vm_events(e) 0L -#define count_vm_event(e) do { } while (0) -#define count_vm_events(e,d) do { } while (0) -#define __count_vm_event(e) do { } while (0) -#define __count_vm_events(e,d) do { } while (0) -#define vm_events_fold_cpu(x) do { } while (0) +static inline void count_vm_event(enum vm_event_item item) +{ +} +static inline void count_vm_events(enum vm_event_item item, long delta) +{ +} +static inline void __count_vm_event(enum vm_event_item item) +{ +} +static inline void __count_vm_events(enum vm_event_item item, long delta) +{ +} +static inline void all_vm_events(unsigned long *ret) +{ +} +static inline void vm_events_fold_cpu(int cpu) +{ +} #endif /* CONFIG_VM_EVENT_COUNTERS */