From 8b97b620f41696f83375a250735268249ce8069a Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 3 Oct 2007 20:42:44 -0700 Subject: [PATCH] vcompound: Debugging aid Virtual fallbacks are rare and thus subtle bugs may creep in if we do not test the fallbacks. CONFIG_VFALLBACK_ALWAYS makes all GFP_VFALLBACK allocations fall back to virtual mapping. Signed-off-by: Christoph Lameter --- lib/Kconfig.debug | 11 +++++++++++ mm/page_alloc.c | 7 +++++++ 2 files changed, 18 insertions(+) Index: linux-2.6.25-rc3-mm1/lib/Kconfig.debug =================================================================== --- linux-2.6.25-rc3-mm1.orig/lib/Kconfig.debug 2008-03-04 18:10:44.453470615 -0800 +++ linux-2.6.25-rc3-mm1/lib/Kconfig.debug 2008-03-04 18:50:10.883701293 -0800 @@ -158,6 +158,17 @@ config DETECT_SOFTLOCKUP can be detected via the NMI-watchdog, on platforms that support it.) +config VFALLBACK_ALWAYS + bool "Always fall back to virtually mapped compound pages" + default y + help + Virtual compound pages are only allocated if there is no linear + memory available. They are a fallback and errors created by the + use of virtual mappings instead of linear ones may not surface + because of their infrequent use. This option makes every + allocation that allows a fallback to a virtual mapping use + the virtual mapping. May have a significant performance impact. + config SCHED_DEBUG bool "Collect scheduler debugging info" depends on DEBUG_KERNEL && PROC_FS Index: linux-2.6.25-rc3-mm1/mm/page_alloc.c =================================================================== --- linux-2.6.25-rc3-mm1.orig/mm/page_alloc.c 2008-03-04 18:15:49.861394752 -0800 +++ linux-2.6.25-rc3-mm1/mm/page_alloc.c 2008-03-07 22:43:15.516273766 -0800 @@ -1514,6 +1514,13 @@ zonelist_scan: } } +#ifdef CONFIG_VFALLBACK_ALWAYS + if ((gfp_mask & __GFP_VFALLBACK) && + system_state == SYSTEM_RUNNING) + return alloc_vcompound(gfp_mask, nodemask, order, + zonelist, high_zoneidx, alloc_flags); +#endif + page = buffered_rmqueue(preferred_zone, zone, order, gfp_mask); if (page) break;