public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Important per-cpu fix.
@ 2002-09-04  2:35 Rusty Russell
  2002-09-04  2:54 ` David S. Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Rusty Russell @ 2002-09-04  2:35 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, davem, akpm

Frankly, I'm amazed the kernel worked for long without this.

Every linker script thinks the section is called .data.percpu.
Without this patch, every CPU ends up sharing the same "per-cpu"
variable.

This might explain the wierd per-cpu problem reports from Andrew and
Dave, and also that nagging feeling that I'm an idiot...

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

--- working-2.5.33-hotcpu-cpudown-i386/include/asm-generic/percpu.h.~1~	Wed Aug 28 09:29:50 2002
+++ working-2.5.33-hotcpu-cpudown-i386/include/asm-generic/percpu.h	Wed Sep  4 12:32:34 2002
@@ -10,7 +10,7 @@
 /* Separate out the type, so (int[3], foo) works. */
 #ifndef MODULE
 #define DEFINE_PER_CPU(type, name) \
-    __attribute__((__section__(".percpu"))) __typeof__(type) name##__per_cpu
+    __attribute__((__section__(".data.percpu"))) __typeof__(type) name##__per_cpu
 #endif
 
 /* var is in discarded region: offset to particular copy we want */

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [PATCH] Important per-cpu fix.
@ 2002-09-05  9:10 Dipankar Sarma
  2002-09-05  9:09 ` William Lee Irwin III
  0 siblings, 1 reply; 32+ messages in thread
From: Dipankar Sarma @ 2002-09-05  9:10 UTC (permalink / raw)
  To: rusty; +Cc: Linus Torvalds, Andrew Morton, Dave Miller, linux-kernel


In article <20020904023535.73D922C12D@lists.samba.org> Rusty Russell wrote:
> Frankly, I'm amazed the kernel worked for long without this.

> Every linker script thinks the section is called .data.percpu.
> Without this patch, every CPU ends up sharing the same "per-cpu"
> variable.

> This might explain the wierd per-cpu problem reports from Andrew and
> Dave, and also that nagging feeling that I'm an idiot...

Not only does this fix the tasklet BUG with 2.5.32 but it also fixes a serial
console hang with my 2.5.32 version of Ingo/Davem/Alexey's scalable timers 
code that I have been debugging for the last two days. I use
a per-cpu tasklet to run the timers, so it was probably killing me
there.

Thanks
-- 
Dipankar Sarma  <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [PATCH] Important per-cpu fix.
@ 2002-09-09 12:17 Matthew Wilcox
  2002-09-09 23:24 ` Rusty Russell
  0 siblings, 1 reply; 32+ messages in thread
From: Matthew Wilcox @ 2002-09-09 12:17 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

Rusty wrote:
> Yeah, but you can still leave a spinlock uninitialized, and it'll
> work.

If your architecture has load-and-zero as its only atomic primitive,
leaving spinlocks uninitialised will _not_ work ;-)

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2002-09-10  9:35 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-04  2:35 [PATCH] Important per-cpu fix Rusty Russell
2002-09-04  2:54 ` David S. Miller
2002-09-04  4:04   ` Rusty Russell
2002-09-04  4:52     ` H. Peter Anvin
2002-09-09  8:06       ` Rusty Russell
2002-09-09  8:16         ` David S. Miller
2002-09-04  5:05     ` David S. Miller
2002-09-04  5:17       ` Linus Torvalds
2002-09-04  5:12         ` David S. Miller
2002-09-04  6:00       ` Rusty Russell
2002-09-04  6:06         ` David S. Miller
2002-09-04  6:19           ` David S. Miller
2002-09-04  7:38             ` Rusty Russell
2002-09-06  9:57               ` Pavel Machek
2002-09-09  3:45                 ` Rusty Russell
2002-09-09  6:13                   ` David S. Miller
2002-09-09  8:17                     ` Rusty Russell
2002-09-09  8:15                       ` David S. Miller
2002-09-09 20:58                         ` Alan Cox
2002-09-09 21:06                           ` Andrew Morton
2002-09-10  9:41                         ` Rusty Russell
2002-09-04 15:44       ` Thunder from the hill
2002-09-04 23:18         ` David S. Miller
2002-09-04  2:56 ` Andrew Morton
2002-09-04  2:46   ` William Lee Irwin III
2002-09-04  3:42 ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2002-09-05  9:10 Dipankar Sarma
2002-09-05  9:09 ` William Lee Irwin III
2002-09-05 19:08   ` Dipankar Sarma
2002-09-05 19:11     ` William Lee Irwin III
2002-09-09 12:17 Matthew Wilcox
2002-09-09 23:24 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox