What if you have a spurious wakeup? Also, nothing prevents the
scheduler from migrating the thread even if it is sleeping. It may not
do so now, but it might do it in the future.
Oh, it probably does now on cpu hotunplug.
Why do you need n.cpu?
Hm. I don't have a good feel on how rare atomic allocation failures are
on common workloads.
Note a kmem_cache for apfs will make failures even more rare.
But, while we're processing an apf, we can't take any more.
So we can have a buffer of one pre-allocated entry per cpu, and do
something like:
apf:
disable apf for this cpu
handle apf using buffered entry
enable interrupts
allocate new entry
buffer it
enable apf for that cpu
this trades off a bigger apf disabled window for not busy looping.
--
error compiling committee.c: too many arguments to function
--