Re: [PATCH 2.4] sys_select() return error on bad file

From: Armin Schindler
Date: Thu Mar 04 2004 - 04:25:34 EST


On Thu, 4 Mar 2004, Willy Tarreau wrote:
> Hi,
>
> On Wed, Mar 03, 2004 at 09:46:54AM +0100, Armin Schindler wrote:
> > --- linux/fs/select.c_orig 2004-03-02 19:06:44.000000000 +0100
> > +++ linux/fs/select.c 2004-03-03 09:25:24.000000000 +0100
> > @@ -183,6 +183,8 @@
> > wait = NULL;
> > retval = 0;
> > for (;;) {
> > + int file_err = 1;
> > +
>
> Just a thought, select() is often performance-critical, and adding one more
> variable inside the loop can slow it down a bit. Wouldn't it be cheaper to
> set retval to -EBADF above and avoid using file_err ?

retval cannot be used for that, it may get changed in the loop.

Anyway, I don't see how your proposal would do better performance?
My patch just adds a new variable on the stack, which should not make any
difference in performance. And later, it is the same if the new or another
variable gets changed or checked.

Armin


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/