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 29, 2020, at 7:18 AM, Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
>
> I don't think so, because it's OK for the percpu_foreach callback to
> mutex_enter/exit on an adaptive lock even though that might sleep.
> What's not OK is sleeping for allocation or other long durations.
> Merely holding percpu_swap_lock during percpu_foreach is enough to
> prevent concurrent percpu_cpu_swap.
The problem with that one is that if it sleeps, it's holding the percpu_swap_lock as a reader, and the failure mode is "someone else calls percpu_alloc() that requires expending the space", and the xcall that deals with that takes percpu_swap_lock as a writer... which means it could block for potentially a long time, and this would prevent other low-priority xcalls from running.
-- thorpej
Home |
Main Index |
Thread Index |
Old Index