Subject: Re: [PATCH] poll: Avoid extra wakeups

From: Andi Kleen <[email-masked]>
Date: Tue, 28 Apr 2009 16:21:38 +0200

Eric Dumazet <[email-masked]> writes:
>
> When scheduled, thread does a full scan of all polled fds and
> can sleep again, because nothing is really available. If number
> of fds is large, this cause significant load.

I wonder if the key could be used for more state. For example if you
two processes are in recvmsg() on a socket and there's only a single
packet incoming we only need to wake up the first waiter.  Could that
be done with keys too?

> This patch makes select()/poll() aware of keyed wakeups and
> useless wakeups are avoided. This reduces number of context
> switches by about 50% on some setups, and work performed
> by sofirq handlers.

I'm late, but: very cool patch too.

Acked-by: Andi Kleen <[email-masked]>

-Andi

-- 
[email-masked] -- Speaking for myself only.