Well, yes I see, but... Ugh, I have a a blind spot here ;)
why this makes any difference from the semantics POV ? why it is bad
to hold the mutex throughout the "full hotplug thing" ?
Yes. but let's suppose we have the single wait_queue, this doesn't make
any difference from the correctness POV, no?
To clarify: I am not arguing! this makes sense, but I'm asking to be sure
I didn't miss a subtle reason why do we "really" need 2 wait_queues.
Also. Let's suppose we have both read- and write- waiters, and cpu_hotplug_done()
does wake_up(writer_queue). It is possible that another reader comes and does
get_online_cpus() and increments .refcount first. After that, cpu_hotplug
is "opened" for the read-lock, but other read-waiters continue to sleep, and
the final put_online_cpus() wakes up write-waiters only. Yes, this all is
correct, but not "symmetrical", and leads to the question "do we really need
2 wait_queues" again.
Oleg.
--