lkml.org 
[lkml]   [2007]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Per-CPU data as a structure
From
Date
"Julio M. Merino Vidal" <jmerino@ac.upc.edu> 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 functionality (such as, e.g., in
> kernel/sched.c).

PDA is an earlier version of percpu; it still can be more efficiently
accessed so it is kept for some low level code.

> 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 lines of different CPUs separate
- Doesn't waste a lot of memory in padding like NR_CPUs arrays usually
need to to avoid the previous point.

Any replacement that doesn't have these properties too will probably
be not useful.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-03 18:25    [W:0.062 / U:2.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site