diff -urN 2.4.10pre12/arch/i386/config.in debug-gfp/arch/i386/config.in
--- 2.4.10pre12/arch/i386/config.in	Thu Sep 20 01:43:26 2001
+++ debug-gfp/arch/i386/config.in	Fri Sep 21 06:36:09 2001
@@ -398,6 +398,7 @@
    bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
    bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
    bool '  Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
+   bool '  Debug allocation faliures' CONFIG_DEBUG_GFP
 fi
 
 endmenu
diff -urN 2.4.10pre12/mm/page_alloc.c debug-gfp/mm/page_alloc.c
--- 2.4.10pre12/mm/page_alloc.c	Thu Sep 20 01:44:20 2001
+++ debug-gfp/mm/page_alloc.c	Fri Sep 21 06:35:55 2001
@@ -401,8 +401,11 @@
 		}
 	}
 
-	printk(KERN_NOTICE "__alloc_pages: %u-order allocation failed (gfp=0x%x/%i) from %p\n",
-	       order, gfp_mask, !!(current->flags & PF_MEMALLOC), __builtin_return_address(0));
+	printk(KERN_NOTICE "__alloc_pages: %u-order allocation failed (gfp=0x%x/%i)\n",
+	       order, gfp_mask, !!(current->flags & PF_MEMALLOC));
+#ifdef CONFIG_DEBUG_GFP
+	show_stack(NULL);
+#endif
 	return NULL;
 }