Messages in this thread | | | Date | Sat, 30 Oct 2010 10:45:37 -0700 (PDT) | From | Davide Libenzi <> | Subject | Re: [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
| |