Messages in this thread | | | Date | Tue, 17 Jun 2014 12:56:35 -0700 | From | "Paul E. McKenney" <> | Subject | Re: [PATCH RFC] percpu: add data dependency barrier in percpu accessors and operations |
| |
On Tue, Jun 17, 2014 at 02:39:46PM -0500, Christoph Lameter wrote: > On Tue, 17 Jun 2014, Paul E. McKenney wrote: > > > We are talking about one CPU initializing all CPUs' portions of > > dynamically allocated per-CPU memory, so there really is more than > > one CPU involved. > > Well that only occurs on initialization before the address of the > struct that contains the offset is available to other processors.
Given runtime dynamic allocation of per-CPU memory, you still need proper synchronization. And yes, on non-Alpha CPUs, the dependency ordering through any pointer suffices on the use side. The thing doing allocation and initialization will still need memory barriers, of course.
> During operation the percpu area functions like a single processor. And > its designed that way to avoid synchronization issues and take full > advantage of *no* synchronization for full speed. We compromise on that > for statistics but that is only read access.
During operation that does not involve cross-CPU accesses, agreed.
Thanx, Paul
| |