Re: Active waiting with yield()

From: Alan Cox
Date: Tue Nov 18 2008 - 09:44:02 EST


> You will touch the wait queue always when finishing the last pending
> request --- just to find out that there is no one waiting on it.

Why ? If my fast path for this something like

if (unlikely(foo->unload_pending) && count == 0)
wake_up(..)

chances are that I can put unload_pending somewhere in a cache line with
other stuff (certainly for L2) and it will get predicted well.

> And besides cache line, there is coding and testing overhead with wait
> queues.

If you want correctness you don't want busy waiting with yields - as Ingo
pointed out already thats a bug in itself with hard realtime.

> So what are the reasons why you (and others) are against active waiting?
> All you are saying is that my reasons are wrong, but you haven't single
> example when active waiting causes trouble. If there is a workload when

Untrue - I've given very clear reasons twice, and Ingo has given you
more. If you don't wish to accept the answers that is your problem not
mine, just expect such hacks to get a NAK and not make the kernel.

Alan
--
"I can only provide the information, I can't make you hear it."
- Shelley Bainter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/