No, the important part is that the process adds itself and marks itself as
sleeping _before_ doing the test. The "marks itself as sleeping" part is
the really important one.
The "removes itself" was/is really just a matter of being able to handle
loops more efficiently (which is probably a case of optimizing for the
wrong thing, since the common case is to wait for just _one_ event,
especially since we made the herd behaviour go away with the exclusive
stuff).
The "removes itself" thing was also something I thought was cleaner (have
the same entity do both add and remove), but I certainly buy into the CPU
lock bouncing arguments against it, so..
> For example, the ordering of the test and add/remove from
> the wait queue is pretty important.
The test and add yes. Remove no, since remove is always done after we know
we're waking up.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/