tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: percpu_foreach() does not execute remotely



> Date: Tue, 28 Jan 2020 08:52:35 -0800
> From: Jason Thorpe <thorpej%me.com@localhost>
> 
> 1- This seems to be a general issue with percpu_foreach().  I mean,
> one of the main purposes of per-cpu storage is that other CPUs don't
> touch it, and percpu_foreach() completely violates the POLA in this
> regard.

I see percpu_foreach as being primarily aimed at initialization and
finalization, for which it is entirely reasonable -- and, at boot
time, perhaps necessary -- to run on the current CPU.

(That said, it would be nice if we had a mechanism that would continue
to work in the event of CPU hotplug to replace percpu_foreach.  But
that's another story.)

> 2- If I were to use xc_broadcast(), then in the case of network
> protocol / interface stats, I would need to use either atomic
> operations or add some other synchronization into the shared
> "exported copy" of the data that's being gathered up.

Why is this different from a hypothetical percpu_foreach_xcall?


Home | Main Index | Thread Index | Old Index