Re: Per-CPU data as a structure

2007-05-04 Thread Andi Kleen
> +/* > + * percpu provides a mechanism to define variables that are specific to > each > + * CPU in the system. > + * > + * Each variable is defined as an independent array of NR_CPUS elements. The independent array term seems misleading to me. There isn't really an array anywhere. Perhaps

Re: Per-CPU data as a structure

2007-05-04 Thread Eric Dumazet
On Fri, 04 May 2007 10:36:37 +0200 "Julio M. Merino Vidal" <[EMAIL PROTECTED]> wrote: > > Anyway, what do you think about adding the above text to the code (percpu.h > maybe) as documentation? See the patch below. (Dunno if the Signed-off-by > line is appropriate as most of the text is

Re: Per-CPU data as a structure

2007-05-04 Thread Julio M. Merino Vidal
Andi Kleen wrote: As far as I can tell, the advantage of percpu is that you can define new "fields" anywhere in the code and independently from the rest of the system. - Independent maintenance as you noted - Fast access and relatively compact code - Avoids false sharing by keeping cache

Re: Per-CPU data as a structure

2007-05-04 Thread Julio M. Merino Vidal
Andi Kleen wrote: As far as I can tell, the advantage of percpu is that you can define new fields anywhere in the code and independently from the rest of the system. - Independent maintenance as you noted - Fast access and relatively compact code - Avoids false sharing by keeping cache

Re: Per-CPU data as a structure

2007-05-04 Thread Eric Dumazet
On Fri, 04 May 2007 10:36:37 +0200 Julio M. Merino Vidal [EMAIL PROTECTED] wrote: Anyway, what do you think about adding the above text to the code (percpu.h maybe) as documentation? See the patch below. (Dunno if the Signed-off-by line is appropriate as most of the text is yours.)

Re: Per-CPU data as a structure

2007-05-04 Thread Andi Kleen
+/* + * percpu provides a mechanism to define variables that are specific to each + * CPU in the system. + * + * Each variable is defined as an independent array of NR_CPUS elements. The independent array term seems misleading to me. There isn't really an array anywhere. Perhaps explain it

Re: Per-CPU data as a structure

2007-05-03 Thread Andi Kleen
"Julio M. Merino Vidal" <[EMAIL PROTECTED]> writes: > Similarly, and if I understood it correctly, the PDA (Per-processor > Data Area) also aims to do the above, but at the moment it only > contains some fields and is not defined in all platforms. There are > still a lot of usages of the percpu

Per-CPU data as a structure

2007-05-03 Thread Julio M. Merino Vidal
Hello, At the moment, data specific to a CPU is stored in different, fixed- size separate arrays by means of the "percpu framework". I'm working on some changes to modify the way some CPUs are represented, and I'm wondering what's the rationale behind such a representation. At first

Per-CPU data as a structure

2007-05-03 Thread Julio M. Merino Vidal
Hello, At the moment, data specific to a CPU is stored in different, fixed- size separate arrays by means of the percpu framework. I'm working on some changes to modify the way some CPUs are represented, and I'm wondering what's the rationale behind such a representation. At first sight,

Re: Per-CPU data as a structure

2007-05-03 Thread Andi Kleen
Julio M. Merino Vidal [EMAIL PROTECTED] writes: Similarly, and if I understood it correctly, the PDA (Per-processor Data Area) also aims to do the above, but at the moment it only contains some fields and is not defined in all platforms. There are still a lot of usages of the percpu