mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* spin-locks
@ 2002-05-10 12:58 Richard B. Johnson
  2002-05-10 13:24 ` spin-locks Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Richard B. Johnson @ 2002-05-10 12:58 UTC (permalink / raw)
  To: Linux kernel

Greetings lock wizards

I have discovered some things that I don't understand.

First, if I create a spin-lock in the ".data" segment it
doesn't work on a SMP machine with two CPUs. I know I am
supposed to use the macros, but I have some high-speed stuff
written in assembly that needs a spin-lock. The 'doesn't work'
is that the spin-lock seems to dead-lock, i.e., they loop
forever with the interrupts disabled. I think what's really
happening is that .data was paged and can't be paged back in
with the interrupts off. I don't know. This stuff used to
work....

In earlier versions of Linux, the locks were in .text_lock.
Now they are in : _text_lock_KBUILD_BASENAME

So, what is special about this area that allows locks to work?
And, what is special about .data that prevents them from working?

Also, there is a potential bug (ducks and hides under the desk) in
the existing spin-lock unlocking. To unlock, the lock is simply
set to 1. This works if you have two CPUs, but what about more?

Shouldn't the lock/unlock just be incremented/decremented so 'N' CPUs
can pound on it?

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

                 Windows-2000/Professional isn't.


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

end of thread, other threads:[~2002-05-10 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-10 12:58 spin-locks Richard B. Johnson
2002-05-10 13:24 ` spin-locks Keith Owens
2002-05-10 14:06   ` spin-locks Richard B. Johnson
2002-05-10 14:17     ` spin-locks David Woodhouse
2002-05-10 14:28       ` spin-locks Richard B. Johnson

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®