From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Vegard Nossum <vegardno@ifi.uio.no>,
Pekka Enberg <penberg@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] arch/x86/mm/kmemcheck/kmemcheck.c: use max cpus
Date: Sat, 31 Oct 2015 15:04:27 +0530 [thread overview]
Message-ID: <1446284067-21062-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
If SMP is enabled then to use kmemcheck we are limiting to one CPU. And
if kmemcheck selftest fails, we are disabling kmemcheck and returning. But
we are still using single CPU even though kmemcheck is disabled.
Use the original max cpu value if kmemcheck selftest fails.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
arch/x86/mm/kmemcheck/kmemcheck.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
index b4f2e7e..4f09508 100644
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -52,8 +52,12 @@ int __init kmemcheck_init(void)
#ifdef CONFIG_SMP
/*
* Limit SMP to use a single CPU. We rely on the fact that this code
- * runs before SMP is set up.
+ * runs before SMP is set up. Save the original value so that if
+ * kmemcheck_selftest() fails we can use the original value
+ * instead of using single CPU.
*/
+ unsigned int orig_max_cpu = setup_max_cpus;
+
if (setup_max_cpus > 1) {
printk(KERN_INFO
"kmemcheck: Limiting number of CPUs to 1.\n");
@@ -64,6 +68,9 @@ int __init kmemcheck_init(void)
if (!kmemcheck_selftest()) {
printk(KERN_INFO "kmemcheck: self-tests failed; disabling\n");
kmemcheck_enabled = 0;
+#ifdef CONFIG_SMP
+ setup_max_cpus = orig_max_cpu;
+#endif
return -EINVAL;
}
--
1.9.1
reply other threads:[~2015-10-31 9:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1446284067-21062-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=tglx@linutronix.de \
--cc=vegardno@ifi.uio.no \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®