From 078d2d20f354289b3c6aece27b6998a8c318f7fe Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 26 Sep 2007 10:46:41 -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 | 6 ++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 495863a..def73ed 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -105,6 +105,17 @@ config DETECT_SOFTLOCKUP can be detected via the NMI-watchdog, on platforms that support it.) +config VFALLBACK_ALWAYS + bool "Always fall back to Virtual 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 diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1be44e2..855397c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1214,6 +1214,12 @@ zonelist_scan: } } +#ifdef CONFIG_VFALLBACK_ALWAYS + if ((gfp_mask & __GFP_VFALLBACK) && + system_state == SYSTEM_RUNNING) + return vcompound_alloc(gfp_mask, order, + zonelist, alloc_flags); +#endif page = buffered_rmqueue(zonelist, zone, order, gfp_mask); if (page) break; -- 1.5.4.1