]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] suppress allocation warnings for radix-tree allocations
authorAndrew Morton <akpm@zip.com.au>
Sun, 5 May 2002 08:09:10 +0000 (01:09 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 5 May 2002 08:09:10 +0000 (01:09 -0700)
The recently-added page allocation failure warning generates a lot of
noise due to radix-tree node allocation failures.  Those messages are
not interesting.

But I think the warning is otherwise useful - "I got an allocation
failure and then it crashed" is better than "it crashed".

The patch suppresses the message for ratnode allocation failures.

include/linux/sched.h
mm/page_alloc.c
mm/vmscan.c

index 09056c01bc8c5630b6c193f2fde16f40122ddddd..af396542c8aeac7d93f1dabecde627d594ca1d90 100644 (file)
@@ -369,6 +369,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
 #define PF_MEMDIE      0x00001000      /* Killed for out-of-memory */
 #define PF_FREE_PAGES  0x00002000      /* per process page freeing */
 #define PF_FLUSHER     0x00004000      /* responsible for disk writeback */
+#define PF_RADIX_TREE  0x00008000      /* debug: performing radix tree alloc */
 
 /*
  * Ptrace flags
index f4600396fcd65dca736121e0fc16ee1ab34000b0..b896e28f0dda518a14217306984065164afbaf72 100644 (file)
@@ -392,8 +392,11 @@ rebalance:
                                return page;
                }
 nopage:
-               printk("%s: page allocation failure. order:%d, mode:0x%x\n",
-                       current->comm, order, gfp_mask);
+               if (!(current->flags & PF_RADIX_TREE)) {
+                       printk("%s: page allocation failure."
+                               " order:%d, mode:0x%x\n",
+                               current->comm, order, gfp_mask);
+               }
                return NULL;
        }
 
index 431fdbef682453b9969d0a9e87dbb6d2ea817f97..42b8ba093e9d56006469a774103332ccf42ca8df 100644 (file)
@@ -58,6 +58,7 @@ swap_out_add_to_swap_cache(struct page *page, swp_entry_t entry)
        int ret;
 
        current->flags &= ~PF_MEMALLOC;
+       current->flags |= PF_RADIX_TREE;
        ret = add_to_swap_cache(page, entry);
        current->flags = flags;
        return ret;