--- select.c.0	Tue Jan 18 12:54:25 2000
+++ select.c	Tue Jan 18 12:54:11 2000
@@ -11,6 +11,7 @@
  */
 
 #include <linux/malloc.h>
+#include <linux/vmalloc.h>
 #include <linux/smp_lock.h>
 #include <linux/poll.h>
 #include <linux/file.h>
@@ -403,7 +404,12 @@
 	}
 
 	size = nfds * sizeof(struct pollfd);
-	fds = (struct pollfd *) kmalloc(size, GFP_KERNEL);
+	if (size > 131070) { /* maximum that slab can allocate */
+		lock_kernel();
+		fds = (struct pollfd *) vmalloc(size);
+		unlock_kernel();
+	} else
+		fds = (struct pollfd *) kmalloc(size, GFP_KERNEL);
 	if (!fds)
 		goto out;
 
@@ -424,7 +430,12 @@
 		err = -EINTR;
 
 out_fds:
-	kfree(fds);
+	if (size > 131070) {
+		lock_kernel();
+		vfree(fds);
+		unlock_kernel();
+	} else
+		kfree(fds);
 out:
 	if (wait)
 		free_wait(wait_table);
