Re: SMP spin-locks

Richard B. Johnson (root@chaos.analogic.com)
Thu, 14 Jun 2001 17:05:07 -0400 (EDT)


On Thu, 14 Jun 2001, Roger Larsson wrote:

> Hi,
>
> Wait a minute...
>
> Spinlocks on a embedded system? Is it _really_ SMP?
>

The embedded system is not SMP. However, there is definite
advantage to using an unmodified kernel that may/may-not
have been compiled for SMP. Of course spin-locks are used
to prevent interrupts from screwing up buffer pointers, etc.

> What kind of performance problem do you have?

The problem is that a data acquisition board across the PCI bus
gives a data transfer rate of 10 to 11 megabytes per second
with a UP kernel, and the transfer drops to 5-6 megabytes per
second with a SMP kernel. The ISR is really simple and copies
data, that's all.

The 'read()' routine uses a spinlock when it modifies pointers.

I started to look into where all the CPU clocks were going. The
SMP spinlock code is where it's going. There is often contention
for the lock because interrupts normally occur at 50 to 60 kHz.

When there is contention, a very long........jump occurs into
the test.lock segment. I think this is flushing queues.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/