tech-kern archive

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

Re: percpu_foreach() does not execute remotely



> On Jan 28, 2020, at 9:01 AM, Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
> 
> 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.

Sure, but that's not the way it's used everywhere.

> (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?

Because percpu_foreach_xcall() would make the xcalls one-by-one, or possibly provide another synchronization mechanism, that would hide the complexity of this from the callers who just want to do a pretty basic thing, but safely and correctly.

-- thorpej



Home | Main Index | Thread Index | Old Index