]> git.neil.brown.name Git - history.git/commitdiff
Import 2.4.0-test4pre2 2.4.0-test4pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:36:33 +0000 (15:36 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:36:33 +0000 (15:36 -0500)
12 files changed:
arch/alpha/kernel/sys_nautilus.c
arch/i386/Makefile
arch/s390/config.in
drivers/sound/Makefile
fs/buffer.c
fs/select.c
include/asm-i386/pgtable.h
include/linux/mm.h
include/linux/poll.h
include/linux/types.h
include/linux/wait.h
mm/vmscan.c

index 32653e3a7482a2d2c4079a165057dad09c9ece80..2115b8d2c1135494a04abb380ed6da028c8eca57 100644 (file)
 static void __init
 nautilus_init_irq(void)
 {
+       if (alpha_using_srm) {
+               alpha_mv.device_interrupt = srm_device_interrupt;
+               alpha_mv.kill_arch = NULL;
+       }
+
        init_i8259a_irqs();
        common_init_isa_dma();
 }
index 3c418f4ef0f8c75d57fb3ebc51ec716c8fe2c6f0..b63dcb89e7d7112b6d635ea9a825aff62af2adc7 100644 (file)
@@ -114,6 +114,8 @@ compressed: zImage
 zlilo: vmlinux
        @$(MAKEBOOT) BOOTIMAGE=zImage zlilo
 
+tmp:
+       @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
 bzlilo: vmlinux
        @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
 
index 96686af335154467fdfe8d74c80bf7d4d45d5a2e..9e946365ffeb86c329d65e991af5ad8111ff8643 100644 (file)
@@ -57,9 +57,6 @@ fi
 
 source fs/Config.in
 
-# Not sure about this one. dwmw2
-# source drivers/mtd/Config.in
-
 # source drivers/char/Config.in
 
 mainmenu_option next_comment
index 10fbd5871e5803790d0afa2160b9f60628498636..399148c74129efd08ce87f9bf2b8d15bbcfd0e38 100644 (file)
@@ -47,7 +47,7 @@ obj-$(CONFIG_SOUND_SOFTOSS)   += softoss2.o
 obj-$(CONFIG_SOUND_SSCAPE)     += sscape.o ad1848.o mpu401.o
 obj-$(CONFIG_SOUND_MAD16)      += mad16.o ad1848.o sb_lib.o uart401.o
 obj-$(CONFIG_SOUND_CS4232)     += cs4232.o uart401.o
-obj-$(CONFIG_SOUND_OPL3SA2)    += opl3sa2.o ad1848.o uart401.o mpu401.o
+obj-$(CONFIG_SOUND_OPL3SA2)    += opl3sa2.o ad1848.o mpu401.o
 obj-$(CONFIG_SOUND_MSS)                += ad1848.o
 obj-$(CONFIG_SOUND_PAS)                += pas2.o sb_lib.o uart401.o
 obj-$(CONFIG_SOUND_SB)         += sb.o sb_lib.o uart401.o
index b1e1c33b73cdacf94308696cbedc6c2d01d70eb6..ba02c8be1b7cb3234ca9cc9f73c85f3009d604b5 100644 (file)
@@ -1759,9 +1759,6 @@ static int do_kio(int rw, int nr, struct buffer_head *bh[], int size)
        int i;
        struct buffer_head *tmp;
 
-       struct task_struct *tsk = current;
-       DECLARE_WAITQUEUE(wait, tsk);
-
        if (rw == WRITE)
                rw = WRITERAW;
        ll_rw_block(rw, nr, bh);
index 86c2793d737764b5eb854479f1e55737bed031b8..a9fd61953ee611889d8d94f6539573583ef76136 100644 (file)
  * poll table.
  */
 
-/*
- * I rewrote this again to make the poll_table size variable, take some
- * more shortcuts, improve responsiveness, and remove another race that
- * Linus noticed.  -- jrs
- */
-
-static poll_table* alloc_wait(int nfds)
+static void free_wait(struct poll_table_page * p)
 {
-       poll_table* out;
-       poll_table* walk;
-
-       out = (poll_table *) __get_free_page(GFP_KERNEL);
-       if(out==NULL)
-               return NULL;
-       out->nr = 0;
-       out->entry = (struct poll_table_entry *)(out + 1);
-       out->next = NULL;
-       nfds -=__MAX_POLL_TABLE_ENTRIES;
-       walk = out;
-       while(nfds > 0) {
-               poll_table *tmp = (poll_table *) __get_free_page(GFP_KERNEL);
-               if (!tmp) {
-                       while(out != NULL) {
-                               tmp = out->next;
-                               free_page((unsigned long)out);
-                               out = tmp;
-                       }
-                       return NULL;
-               }
-               tmp->nr = 0;
-               tmp->entry = (struct poll_table_entry *)(tmp + 1);
-               tmp->next = NULL;
-               walk->next = tmp;
-               walk = tmp;
-               nfds -=__MAX_POLL_TABLE_ENTRIES;
-       }
-       return out;
-}
-
-static void free_wait(poll_table * p)
-{
-       struct poll_table_entry * entry;
-       poll_table *old;
-
        while (p) {
+               struct poll_table_entry * entry;
+               struct poll_table_page *old;
+
                entry = p->entry + p->nr;
                while (p->nr > 0) {
                        p->nr--;
@@ -97,19 +58,33 @@ static void free_wait(poll_table * p)
 
 void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
 {
-       for (;;) {
-               if (p->nr < __MAX_POLL_TABLE_ENTRIES) {
-                       struct poll_table_entry * entry;
-                       entry = p->entry + p->nr;
-                       get_file(filp);
-                       entry->filp = filp;
-                       entry->wait_address = wait_address;
-                       init_waitqueue_entry(&entry->wait, current);
-                       add_wait_queue(wait_address,&entry->wait);
-                       p->nr++;
+       struct poll_table_page *table = p->table;
+
+       if (!table || table->nr >= __MAX_POLL_TABLE_ENTRIES) {
+               struct poll_table_page *new_table;
+
+               new_table = (struct poll_table_page *) __get_free_page(GFP_KERNEL);
+               if (!new_table) {
+                       p->error = -ENOMEM;
                        return;
                }
-               p = p->next;
+               new_table->nr = 0;
+               new_table->entry = (struct poll_table_entry *)(new_table + 1);
+               new_table->next = table;
+               p->table = new_table;
+               table = new_table;
+       }
+
+       /* Add a new entry */
+       {
+               struct poll_table_entry * entry;
+               entry = table->entry + table->nr;
+               table->nr++;
+               get_file(filp);
+               entry->filp = filp;
+               entry->wait_address = wait_address;
+               init_waitqueue_entry(&entry->wait, current);
+               add_wait_queue(wait_address,&entry->wait);
        }
 }
 
@@ -173,12 +148,10 @@ get_max:
 
 int do_select(int n, fd_set_bits *fds, long *timeout)
 {
-       poll_table *wait, *orig_wait;
+       poll_table table, *wait;
        int retval, i, off;
        long __timeout = *timeout;
 
-       orig_wait = wait = NULL;
-
        read_lock(&current->files->file_lock);
        retval = max_select_fd(n, fds);
        read_unlock(&current->files->file_lock);
@@ -186,11 +159,10 @@ int do_select(int n, fd_set_bits *fds, long *timeout)
        if (retval < 0)
                return retval;
        n = retval;
-       if (__timeout) {
-               orig_wait = wait = alloc_wait(n);
-               if (!wait)
-                       return -ENOMEM;
-       }
+
+       table.error = 0;
+       table.table = NULL;
+       wait = &table;
        retval = 0;
        for (;;) {
                set_current_state(TASK_INTERRUPTIBLE);
@@ -233,7 +205,7 @@ int do_select(int n, fd_set_bits *fds, long *timeout)
        }
        current->state = TASK_RUNNING;
 
-       free_wait(orig_wait);
+       free_wait(table.table);
 
        /*
         * Up-to-date the caller timeout.
@@ -404,7 +376,7 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
 {
        int i, j, fdcount, err;
        struct pollfd **fds;
-       poll_table *wait = NULL;
+       poll_table table;
        int nchunks, nleft;
 
        /* Do a sanity check on nfds ... */
@@ -419,11 +391,8 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
                        timeout = MAX_SCHEDULE_TIMEOUT;
        }
 
-       if (timeout) {
-               wait = alloc_wait(nfds);
-               if (!wait)
-                       return -ENOMEM;
-       }
+       table.error = 0;
+       table.table = NULL;
        err = -ENOMEM;
 
        fds = NULL;
@@ -460,7 +429,7 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
                        goto out_fds1;
        }
 
-       fdcount = do_poll(nfds, nchunks, nleft, fds, wait, timeout);
+       fdcount = do_poll(nfds, nchunks, nleft, fds, &table, timeout);
 
        /* OK, now copy the revents fields back to user space. */
        for(i=0; i < nchunks; i++)
@@ -483,6 +452,6 @@ out_fds:
        if (nfds != 0)
                kfree(fds);
 out:
-       free_wait(wait);
+       free_wait(table.table);
        return err;
 }
index cadb5cbf756ab7b99ef4f565546165cc302add00..cfa011108cb02fd2cf0515c689eeab6b62325875 100644 (file)
@@ -244,7 +244,7 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd);
  * Permanent address of a page. Obviously must never be
  * called on a highmem page.
  */
-#define page_address(page) ({ if (!(page)->virtual) BUG(); (page)->virtual; })
+#define page_address(page) ((page)->virtual)
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
 #define pte_page(x) (mem_map+pte_pagenr(x))
 
index e6325a2980d571162425cd8325cbe4c98577ea85..f418100a927542a77844f5275469b0322444c40b 100644 (file)
@@ -316,9 +316,6 @@ extern struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order
 #ifndef CONFIG_DISCONTIGMEM
 static inline struct page * alloc_pages(int gfp_mask, unsigned long order)
 {
-       /*  temporary check. */
-       if (contig_page_data.node_zonelists[gfp_mask].gfp_mask != (gfp_mask))
-               BUG();
        /*
         * Gets optimized away by the compiler.
         */
index b56cdcf4c2f369fccb6ba2776dba84a16d7a7b12..bc0fcde22bc3cfdca546f02a42b32f9a1a685fd7 100644 (file)
@@ -17,13 +17,18 @@ struct poll_table_entry {
        wait_queue_head_t * wait_address;
 };
 
-typedef struct poll_table_struct {
-       struct poll_table_struct * next;
+struct poll_table_page {
+       struct poll_table_page * next;
        unsigned int nr;
        struct poll_table_entry * entry;
+};
+
+typedef struct poll_table_struct {
+       int error;
+       struct poll_table_page * table;
 } poll_table;
 
-#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (poll_table)) / sizeof (struct poll_table_entry))
+#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (struct poll_table_page)) / sizeof (struct poll_table_entry))
 
 extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
 
index 196c5f4e0ca1ff5db07d10da7b6a0f3fd975d34c..df4808fcdf45578b502ba25e7b287689461acb92 100644 (file)
@@ -1,7 +1,10 @@
 #ifndef _LINUX_TYPES_H
 #define _LINUX_TYPES_H
 
+#ifdef __KERNEL__
 #include <linux/config.h>
+#endif
+
 #include <linux/posix_types.h>
 #include <asm/types.h>
 
index 6ac1f0e88fe47ce31db3c6ae48144310cc6c3320..222923acaf57e7a369a266a7e413b9a7f85907d5 100644 (file)
@@ -21,7 +21,7 @@
  * Temporary debugging help until all code is converted to the new
  * waitqueue usage.
  */
-#define WAITQUEUE_DEBUG 1
+#define WAITQUEUE_DEBUG 0
 
 #if WAITQUEUE_DEBUG
 extern int printk(const char *fmt, ...);
index d5008c7ec262fa6fc690bc32f42397201262ffcb..f19721ee5920f8fe9b860465c8722370955cdac8 100644 (file)
@@ -626,6 +626,7 @@ int try_to_free_pages(unsigned int gfp_mask)
        int retval = 1;
 
        if (gfp_mask & __GFP_WAIT) {
+               current->state = TASK_RUNNING;
                current->flags |= PF_MEMALLOC;
                retval = do_try_to_free_pages(gfp_mask);
                current->flags &= ~PF_MEMALLOC;