Re: [PATCH] fix __pollwait()

From: Arne Georg Gleditsch (argggh@ping.uio.no)
Date: Sun Apr 16 2000 - 11:23:56 EST


* Manfred Spraul <manfreds@colorfullife.com>
> The patch below changes __pollwait(): the old code called gfp() with
> !TASK_RUNNING.
>
> I've tested the patch with 2.2.14 i386 UP, could you add it to the next
> 2.2 kernel?

This patch breaks things for me. When selecting on a large number
(128 in i386, 64 on alpha) of ptys the kernel oopses with an "Unable
to handle kernel NULL pointer dereference at virtual address 00000004"
message.

As far as I can tell this is because only one poll table entry is
allocated for each fd in alloc_wait, while (at least)
drivers/char/n_tty.c:normal_poll calls poll_wait twice, thus using two
poll table entries for each file descriptor. I fixed it here by
simply doing

--- linux/fs/select.c.orig Thu Apr 6 18:02:42 2000
+++ linux/fs/select.c Fri Apr 14 23:01:58 2000
@@ -44,6 +44,7 @@
         poll_table* out;
         poll_table* walk;
 
+ nfds *= 2;
         out = (poll_table *) __get_free_page(GFP_KERNEL);
         if(out==NULL)
                 return NULL;

Which seems to make things work as expected again.

                                                        Arne.

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



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:09 EST