From: Robert Love <rml@tech9.net>
To: linux-kernel@vger.kernel.org
Cc: davej@suse.de
Subject: [PATCH] 2.5: mark variables as __initdata
Date: 19 Jun 2002 10:47:38 -0700 [thread overview]
Message-ID: <1024508859.1038.50.camel@sinai> (raw)
The attached patch marks the following variables with __initdata:
arch/i386/kernel/mpparse.c :: static unsigned int num_processors
arch/i386/kernel/smpboot.c :: static int smp_b_stepping
arch/i386/kernel/smpboot.c :: static int max_cpus
The data is static and only used by __init functions so can successfully
be jettisoned after boot. Compiled and booted successfully on an SMP
machine.
I also set max_cpus to NR_CPUS instead of -1. Besides being the
logically correct value and simplifying a loop elsewhere, this change
allows NR_CPUS to be set to various values other than the normal 32
which is growing in utility with the hotplug CPU changes now in
mainline.
Patch is against 2.5.23.
Robert Love
diff -urN linux-2.5.23/arch/i386/kernel/mpparse.c linux/arch/i386/kernel/mpparse.c
--- linux-2.5.23/arch/i386/kernel/mpparse.c Tue Jun 18 19:11:51 2002
+++ linux/arch/i386/kernel/mpparse.c Wed Jun 19 10:32:10 2002
@@ -64,7 +64,7 @@
unsigned int boot_cpu_physical_apicid = -1U;
unsigned int boot_cpu_logical_apicid = -1U;
/* Internal processor count */
-static unsigned int num_processors;
+static unsigned int __initdata num_processors;
/* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map;
diff -urN linux-2.5.23/arch/i386/kernel/smpboot.c linux/arch/i386/kernel/smpboot.c
--- linux-2.5.23/arch/i386/kernel/smpboot.c Tue Jun 18 19:11:54 2002
+++ linux/arch/i386/kernel/smpboot.c Wed Jun 19 10:32:10 2002
@@ -50,11 +50,11 @@
#include <asm/tlbflush.h>
#include <asm/smpboot.h>
-/* Set if we find a B stepping CPU */
-static int smp_b_stepping;
+/* Set if we find a B stepping CPU */
+static int __initdata smp_b_stepping;
/* Setup configured maximum number of CPUs to activate */
-static int max_cpus = -1;
+static int __initdata max_cpus = NR_CPUS;
/* Number of siblings per CPU package */
int smp_num_siblings = 1;
@@ -1146,7 +1146,7 @@
if (!(phys_cpu_present_map & (1 << bit)))
continue;
- if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
+ if (max_cpus <= cpucount+1)
continue;
do_boot_cpu(apicid);
reply other threads:[~2002-06-19 17:47 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=1024508859.1038.50.camel@sinai \
--to=rml@tech9.net \
--cc=davej@suse.de \
--cc=linux-kernel@vger.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®