]> git.hungrycats.org Git - linux/commitdiff
[PATCH] page_alloc failure printk
authorAndrew Morton <akpm@zip.com.au>
Tue, 30 Apr 2002 06:51:26 +0000 (23:51 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 30 Apr 2002 06:51:26 +0000 (23:51 -0700)
Emit a printk when a page allocation fails.  Considered useful for
diagnosing crashes.

mm/page_alloc.c

index 5f0fa6e6c2f207e09de71dba2c5db0887c82c283..ea28ddeb8a528042f7a3058948858d6cdce0ef56 100644 (file)
@@ -394,12 +394,15 @@ rebalance:
                        if (page)
                                return page;
                }
+nopage:
+               printk("%s: page allocation failure. order:%d, mode:0x%x\n",
+                       current->comm, order, gfp_mask);
                return NULL;
        }
 
        /* Atomic allocations - we can't balance anything */
        if (!(gfp_mask & __GFP_WAIT))
-               return NULL;
+               goto nopage;
 
        page = balance_classzone(classzone, gfp_mask, order, &freed);
        if (page)
@@ -422,7 +425,7 @@ rebalance:
 
        /* Don't let big-order allocations loop */
        if (order > 3)
-               return NULL;
+               goto nopage;
 
        /* Yield for kswapd, and try again */
        __set_current_state(TASK_RUNNING);