mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 01/08] percpu -v2 main.c setup
@ 2006-04-15  3:10 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2006-04-15  3:10 UTC (permalink / raw)
  To: LKML

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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-15  3:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-15  3:10 [PATCH 01/08] percpu -v2 main.c setup Steven Rostedt

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®