[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090429091637.GA29874@elte.hu>
Date: Wed, 29 Apr 2009 11:16:37 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Eric Dumazet <dada1@...mosbay.com>
Cc: linux kernel <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>,
David Miller <davem@...emloft.net>, cl@...ux.com,
jesse.brandeburg@...el.com, netdev@...r.kernel.org,
haoki@...hat.com, mchan@...adcom.com, davidel@...ilserver.org
Subject: Re: [PATCH] poll: Avoid extra wakeups in select/poll
* Eric Dumazet <dada1@...mosbay.com> wrote:
> @@ -418,8 +429,16 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
> if (file) {
> f_op = file->f_op;
> mask = DEFAULT_POLLMASK;
> - if (f_op && f_op->poll)
> + if (f_op && f_op->poll) {
> + if (wait) {
> + wait->key = POLLEX_SET;
> + if (in & bit)
> + wait->key |= POLLIN_SET;
> + if (out & bit)
> + wait->key |= POLLOUT_SET;
> + }
> mask = (*f_op->poll)(file, retval ? NULL : wait);
> + }
> fput_light(file, fput_needed);
> if ((mask & POLLIN_SET) && (in & bit)) {
> res_in |= bit;
Please factor this whole 'if (file)' branch out into a helper.
Typical indentation levels go from 1 to 3 tabs - 4 should be avoided
if possible and 5 is pretty excessive already. This goes to eight.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists