From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: [05/11] vcompound: Debugging aid
Date: Tue, 29 Apr 2008 21:42:56 -0700 [thread overview]
Message-ID: <20080430044320.082665180@sgi.com> (raw)
In-Reply-To: 20080430044251.266380837@sgi.com
[-- Attachment #1: vcp_debugging_aids --]
[-- Type: text/plain, Size: 2669 bytes --]
Virtualized Compound Pages are rare in practice and thus subtle bugs may
creep in if we do not test the kernel with Virtualized Compounds.
CONFIG_VIRTUALIZE_ALWAYS results in virtualizable compound allocation
requests always result in virtualized compounds.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
lib/Kconfig.debug | 12 ++++++++++++
mm/vmalloc.c | 15 +++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
Index: linux-2.6/lib/Kconfig.debug
===================================================================
--- linux-2.6.orig/lib/Kconfig.debug 2008-04-29 21:27:20.452525154 -0700
+++ linux-2.6/lib/Kconfig.debug 2008-04-29 21:27:36.533025562 -0700
@@ -159,6 +159,18 @@ config DETECT_SOFTLOCKUP
can be detected via the NMI-watchdog, on platforms that
support it.)
+config VIRTUALIZE_ALWAYS
+ bool "Always allocate virtualized compounds pages"
+ default y
+ help
+ Virtualized compound pages are only allocated if there is no linear
+ memory available. They are a fallback and potential issues created by
+ the use of virtual mappings instead of physically linear memory may
+ not surface because of the infrequent need to create them. Enabling
+ this option makes every allocation of a virtualizable compound page
+ generate virtualized compound page. May have a significant
+ performance impact. Only for testing.
+
config SCHED_DEBUG
bool "Collect scheduler debugging info"
depends on DEBUG_KERNEL && PROC_FS
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c 2008-04-29 21:27:32.237026026 -0700
+++ linux-2.6/mm/vmalloc.c 2008-04-29 21:27:36.537025989 -0700
@@ -1191,6 +1191,11 @@ struct page *alloc_vcompound_node(int no
if (order)
alloc_flags |= __GFP_COMP;
+#ifdef CONFIG_VIRTUALIZE_ALWAYS
+ if (system_state == SYSTEM_RUNNING && order)
+ page = NULL;
+ else
+#endif
if (node == -1) {
page = alloc_pages(alloc_flags, order);
} else
@@ -1212,8 +1217,14 @@ void *__alloc_vcompound(gfp_t flags, int
struct vm_struct *vm;
void *addr;
- addr = (void *)__get_free_pages(flags | __GFP_NORETRY | __GFP_NOWARN,
- order);
+#ifdef CONFIG_VIRTUALIZE_ALWAYS
+ if (system_state == SYSTEM_RUNNING && order)
+ addr = NULL;
+ else
+#endif
+ addr = (void *)__get_free_pages(
+ flags | __GFP_NORETRY | __GFP_NOWARN, order);
+
if (addr || !order)
return addr;
--
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-04-30 4:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 4:42 [00/11] Virtualizable Compound Page Support V5 Christoph Lameter
2008-04-30 4:42 ` [01/11] vmalloc: Return page array on vunmap Christoph Lameter
2008-04-30 4:42 ` [02/11] vcompound: pageflags: Add PageVcompound() Christoph Lameter
2008-04-30 4:42 ` [03/11] vmallocinfo: Support display of virtualized compound pages Christoph Lameter
2008-04-30 4:42 ` [04/11] vcompound: Core piece for virtualizable compound page allocation Christoph Lameter
2008-04-30 4:42 ` Christoph Lameter [this message]
2008-04-30 4:42 ` [06/11] sparsemem: Use virtualizable compound page Christoph Lameter
2008-04-30 4:42 ` [07/11] vcompound: bit waitqueue support Christoph Lameter
2008-04-30 4:42 ` [08/11] crypto: Use virtualizable compounds for temporary order 2 allocation Christoph Lameter
2008-04-30 4:43 ` [09/11] slub: Use virtualizable compound for buffer Christoph Lameter
2008-04-30 4:43 ` [10/11] vcompound: Fallback for zone wait table Christoph Lameter
2008-04-30 4:43 ` [11/11] e1000: Avoid vmalloc through virtualizable compound page Christoph Lameter
2008-04-30 4:43 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080430044320.082665180@sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.