Re: select(0, ..) is valid ?

2007-05-22 Thread Steve Fox
On Wed, 2007-05-16 at 17:59 -0700, Badari Pulavarty wrote: Here it is .. Should I do one for poll() also ? Thanks, Badari Optimize select by a using stack space for small fd sets. core_sys_select() already has this optimization. This is for compat version. Signed-off-by: Badari

Re: select(0, ..) is valid ?

2007-05-22 Thread Nishanth Aravamudan
On 22.05.2007 [09:16:37 -0500], Steve Fox wrote: On Wed, 2007-05-16 at 17:59 -0700, Badari Pulavarty wrote: Here it is .. Should I do one for poll() also ? Thanks, Badari Optimize select by a using stack space for small fd sets. core_sys_select() already has this

Re: select(0, ..) is valid ?

2007-05-22 Thread Steve Fox
On Tue, 2007-05-22 at 07:34 -0700, Nishanth Aravamudan wrote: On 22.05.2007 [09:16:37 -0500], Steve Fox wrote: Andy put this through a couple machines on test.kernel.org and elm3b6 was fixed, however elm3b239 still had a boot error. BUG: at mm/slab.c:777 __find_general_cachep()

Re: select(0, ..) is valid ?

2007-05-21 Thread Nish Aravamudan
On 5/18/07, Andi Kleen [EMAIL PROTECTED] wrote: On Wednesday 16 May 2007 17:37, Anton Blanchard wrote: Hi Hugh, It's interesting that compat_core_sys_select() shows this kmalloc(0) failure but core_sys_select() does not. That's because core_sys_select() avoids kmalloc by using a buffer

Re: select(0, ..) is valid ?

2007-05-18 Thread Andi Kleen
On Wednesday 16 May 2007 17:37, Anton Blanchard wrote: Hi Hugh, It's interesting that compat_core_sys_select() shows this kmalloc(0) failure but core_sys_select() does not. That's because core_sys_select() avoids kmalloc by using a buffer on the stack for small allocations (and 0 sure

Re: select(0, ..) is valid ?

2007-05-16 Thread Anton Blanchard
Hi Hugh, It's interesting that compat_core_sys_select() shows this kmalloc(0) failure but core_sys_select() does not. That's because core_sys_select() avoids kmalloc by using a buffer on the stack for small allocations (and 0 sure is small). Shouldn't compat_core_sys_select() do just the

Re: select(0, ..) is valid ?

2007-05-16 Thread Badari Pulavarty
On Wed, 2007-05-16 at 10:37 -0500, Anton Blanchard wrote: Hi Hugh, It's interesting that compat_core_sys_select() shows this kmalloc(0) failure but core_sys_select() does not. That's because core_sys_select() avoids kmalloc by using a buffer on the stack for small allocations (and 0

Re: select(0, ..) is valid ?

2007-05-15 Thread Mark Glines
On Tue, 15 May 2007 10:29:18 -0700 Badari Pulavarty [EMAIL PROTECTED] wrote: Hi, Is select(0, ..) is a valid operation ? select(0, ..) is rather commonly used as a portable sleep() with microsecond granularity. Disabling it will break lots of things. Mark - To unsubscribe from this list:

Re: select(0, ..) is valid ?

2007-05-15 Thread Jiri Slaby
Badari Pulavarty napsal(a): Hi, Is select(0, ..) is a valid operation ? Yes, it was (is) sometimes used for measuring (sleeping for) short time slices. regards, -- http://www.fi.muni.cz/~xslaby/Jiri Slaby faculty of informatics, masaryk university, brno, cz e-mail: jirislaby

Re: select(0, ..) is valid ?

2007-05-15 Thread Alan Cox
On Tue, 15 May 2007 10:29:18 -0700 Badari Pulavarty [EMAIL PROTECTED] wrote: Hi, Is select(0, ..) is a valid operation ? Yes. It's a fairly classic old BSD way to do timeouts Alan - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED]

Re: select(0, ..) is valid ?

2007-05-15 Thread Andrew Morton
On Tue, 15 May 2007 10:29:18 -0700 Badari Pulavarty [EMAIL PROTECTED] wrote: Hi, Is select(0, ..) is a valid operation ? Probably - it becomes an elaborate way of doing a sleep. Whatever - we used to permit it without error, so we should continue to do so. I see that there is no check to

Re: select(0, ..) is valid ?

2007-05-15 Thread H. Peter Anvin
Badari Pulavarty wrote: Hi, Is select(0, ..) is a valid operation ? I see that there is no check to prevent this or return success early, without doing any work. Do we need one ? slub code is complaining that we are doing kmalloc(0). select(0, ...) is valid, and is functionally

Re: select(0, ..) is valid ?

2007-05-15 Thread Badari Pulavarty
On Tue, 2007-05-15 at 10:44 -0700, Andrew Morton wrote: On Tue, 15 May 2007 10:29:18 -0700 Badari Pulavarty [EMAIL PROTECTED] wrote: Hi, Is select(0, ..) is a valid operation ? Probably - it becomes an elaborate way of doing a sleep. Whatever - we used to permit it without error,

Re: select(0, ..) is valid ?

2007-05-15 Thread Christoph Lameter
On Tue, 15 May 2007, Andrew Morton wrote: I _think_ we can just do --- a/fs/compat.c~a +++ a/fs/compat.c @@ -1566,9 +1566,13 @@ int compat_core_sys_select(int n, compat */ ret = -ENOMEM; size = FDS_BYTES(n); - bits = kmalloc(6 * size, GFP_KERNEL); - if

Re: select(0, ..) is valid ?

2007-05-15 Thread Andrew Morton
On Tue, 15 May 2007 11:10:22 -0700 (PDT) Christoph Lameter [EMAIL PROTECTED] wrote: On Tue, 15 May 2007, Andrew Morton wrote: I _think_ we can just do --- a/fs/compat.c~a +++ a/fs/compat.c @@ -1566,9 +1566,13 @@ int compat_core_sys_select(int n, compat */ ret = -ENOMEM;

Re: select(0, ..) is valid ?

2007-05-15 Thread Christoph Lameter
On Tue, 15 May 2007, Andrew Morton wrote: Perhaps putting a size=0 detector into slab also would speed this process up. Signed-off-by: Christoph Lameter [EMAIL PROTECTED] Index: linux-2.6/mm/slab.c === ---

Re: select(0, ..) is valid ?

2007-05-15 Thread Hugh Dickins
On Tue, 15 May 2007, Christoph Lameter wrote: On Tue, 15 May 2007, Andrew Morton wrote: I _think_ we can just do --- a/fs/compat.c~a +++ a/fs/compat.c @@ -1566,9 +1566,13 @@ int compat_core_sys_select(int n, compat */ ret = -ENOMEM; size = FDS_BYTES(n); - bits