lkml.org 
[lkml]   [2010]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] af_unix: optimize unix_dgram_poll()
On Sat, 30 Oct 2010, Eric Dumazet wrote:

> Le vendredi 29 octobre 2010 à 13:46 -0700, Davide Libenzi a écrit :
>
> > Also, why not using the existing wait->key instead of adding a poll2()?
>
> Indeed, if wait is not null, we have in wait->key the interest of
> poller. If a particular poll() function is expensive, it can test these
> bits.
>
> Thanks !
>
> Note: I chose the 'goto skip_write' to make this patch really obvious.

Plain agreement on th patch, and I understand the indent overflow
concerns, but why not ...

/*
* No write status requested, avoid expensive OUT tests.
*/
if (wait && !(wait->key & (POLLWRBAND | POLLWRNORM | POLLOUT)))
return mask

The write-test code is the last one we do anyway.


- Davide

\
 
 \ /
  Last update: 2010-10-30 19:49    [W:0.111 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site