From: Vegard Nossum <vegard.nossum@gmail.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>, Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <andi@firstfloor.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] kmemcheck: don't track pages allocated with interrupts disabled
Date: Sat, 7 Jun 2008 16:32:42 +0200 [thread overview]
Message-ID: <20080607143242.GA2893@damson.getinternet.no> (raw)
Hi,
It seems that I was wrong regarding the set_memory_4k() approach. It seems
to only have worked because we were lucky. We may later reinstate the code
to disable PSE, but this time not unconditionally, perhaps with a config
option or boot-time option.
That a new page needs to be allocated with interrupts disabled is probably
rare enough that we can get away with this without losing too many pages
that could otherwise have been tracked.
Again, this is overall nicer than unconditionally disabling PSE, since
that incurs a much larger overhead in the case where kmemcheck is enabled
in the config but disabled by default. (Ingo, you previously indicated that
it would be nice if kernels could be configured in this way by default.)
Vegard
From: Vegard Nossum <vegardno@ben.ifi.uio.no>
Date: Sat, 7 Jun 2008 16:18:29 +0200
Subject: [PATCH] kmemcheck: don't track pages allocated with interrupts disabled
Because large physical pages need to be split to 4k-sized pages after
the slab page has been allocated, and this needs to flush the page
tables, we cannot track any pages that were allocated while interrupts
were disabled.
This fixes a boot crash that seems to depend on timing to appear.
Signed-off-by: Vegard Nossum <vegardno@ben.ifi.uio.no>
---
mm/kmemcheck.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/mm/kmemcheck.c b/mm/kmemcheck.c
index 4efdf1e..b337374 100644
--- a/mm/kmemcheck.c
+++ b/mm/kmemcheck.c
@@ -10,6 +10,14 @@ void kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node,
int pages;
int i;
+ /*
+ * It's sad, but it's true. If interrupts are enabled while making
+ * this allocation, it means that we can't split the large page
+ * because it would require flushing the page tables.
+ */
+ if (irqs_disabled())
+ return;
+
pages = 1 << order;
/*
--
1.5.3.1
next reply other threads:[~2008-06-07 14:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-07 14:32 Vegard Nossum [this message]
2008-06-07 17:12 ` [PATCH] kmemcheck: don't track pages allocated with interrupts disabled Andi Kleen
2008-06-07 18:15 ` Vegard Nossum
2008-06-07 19:47 ` Andi Kleen
2008-06-07 20:19 ` Vegard Nossum
2008-06-07 18:18 ` Vegard Nossum
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=20080607143242.GA2893@damson.getinternet.no \
--to=vegard.nossum@gmail.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
/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.