From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Mike Travis <travis@sgi.com>
Subject: [PATCH 1/6] cpumask: make CONFIG_NR_CPUS always valid.
Date: Mon, 1 Dec 2008 18:46:44 +1030 [thread overview]
Message-ID: <200812011846.44406.rusty@rustcorp.com.au> (raw)
Impact: cleanup
Currently we have NR_CPUS, which is 1 on UP, and CONFIG_NR_CPUS on
SMP. If we make CONFIG_NR_CPUS always valid (and always 1 on !SMP),
we can skip the middleman.
This also allows us to find and check all the remaining NR_CPUS users.
To avoid breaking every arch, we cheat and do this for the moment
in the header if the arch doesn't.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
---
include/linux/threads.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff -r 329e9ec99074 include/linux/threads.h
--- a/include/linux/threads.h Thu Oct 23 23:46:33 2008 +1100
+++ b/include/linux/threads.h Thu Oct 23 23:50:50 2008 +1100
@@ -8,16 +8,16 @@
*/
/*
- * Maximum supported processors that can run under SMP. This value is
- * set via configure setting. The maximum is equal to the size of the
- * bitmasks used on that platform, i.e. 32 or 64. Setting this smaller
- * saves quite a bit of memory.
+ * Maximum supported processors. Setting this smaller saves quite a
+ * bit of memory. Use nr_cpu_ids instead of this except for static bitmaps.
*/
-#ifdef CONFIG_SMP
+#ifndef CONFIG_NR_CPUS
+/* FIXME: This should be fixed in the arch's Kconfig */
+#define CONFIG_NR_CPUS 1
+#endif
+
+/* Places which use this should consider cpumask_var_t. */
#define NR_CPUS CONFIG_NR_CPUS
-#else
-#define NR_CPUS 1
-#endif
#define MIN_THREADS_LEFT_FOR_ROOT 4
reply other threads:[~2008-12-01 8:16 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=200812011846.44406.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=travis@sgi.com \
/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