From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 01/08] percpu -v2 main.c setup
Date: Fri, 14 Apr 2006 23:10:35 -0400 [thread overview]
Message-ID: <1145070635.27407.28.camel@localhost.localdomain> (raw)
Copy the __per_cpu_offset array into the per_cpu_offset__##var variables.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: linux-2.6.17-rc1/init/main.c
===================================================================
--- linux-2.6.17-rc1.orig/init/main.c 2006-04-13 22:37:57.000000000 -0400
+++ linux-2.6.17-rc1/init/main.c 2006-04-14 11:46:51.000000000 -0400
@@ -324,9 +324,11 @@ static inline void smp_prepare_cpus(unsi
#ifdef __GENERIC_PER_CPU
unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
-
EXPORT_SYMBOL(__per_cpu_offset);
+extern unsigned long *__per_cpu_offset_start,
+ *__per_cpu_offset_end;
+
static void __init setup_per_cpu_areas(void)
{
unsigned long size, i;
@@ -335,12 +337,18 @@ static void __init setup_per_cpu_areas(v
/* Copy section for each CPU (we discard the original) */
size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
-#ifdef CONFIG_MODULES
- if (size < PERCPU_ENOUGH_ROOM)
- size = PERCPU_ENOUGH_ROOM;
-#endif
ptr = alloc_bootmem(size * nr_possible_cpus);
+#ifdef CONFIG_MODULES
+ {
+ unsigned long **offsets = &__per_cpu_offset_start;
+ printk("setting up percpu from %p to %p with %p\n",
+ &__per_cpu_offset_start, &__per_cpu_offset_end,
+ &__per_cpu_offset[0]);
+ for ( ; offsets < &__per_cpu_offset_end; offsets++)
+ *offsets = &__per_cpu_offset[0];
+ }
+#endif
for_each_possible_cpu(i) {
__per_cpu_offset[i] = ptr - __per_cpu_start;
memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
reply other threads:[~2006-04-15 3:10 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=1145070635.27407.28.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--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®