Re: [PATCH] fix vmstat per cpu usage

Paul Mackerras
2006-08-01T22:44:49Z

Andrew Morton writes:

> On Tue, 1 Aug 2006 19:36:21 +0200
> Jan Blunck <jblunck@suse.de> wrote:
>
> > The per cpu variables are used incorrectly in vmstat.h.
[snip]
> > - __get_cpu_var(vm_event_states.event[item])++;
> > + __get_cpu_var(vm_event_states).event[item]++;
> > }
>
> How odd. Are there any negative consequences to the existing code?

That sort of thing - i.e. using __get_cpu_var on something which isn't
just a simple variable name - works with the current per-cpu macro
definitions, because they are pretty simple, but one can imagine other
reasonable implementations of __get_cpu_var which need the argument to
be a simple variable name. I struck this when I was experimenting
with using __thread variables for per-cpu data.

Paul.