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

From: Eric Dumazet <[email-masked]>
Date: Tue, 28 Apr 2009 16:58:36 +0200

Andi Kleen a écrit :
> 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?

I am not sure its possible. I'll take a look.

> 
>> 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]>

Thanks, I am going to send it again on lkml this time :)