Re: [linuxsh-dev] [PATCH] Preemptible kernel for SH

Robert Love (rml@tech9.net)
03 Dec 2001 17:18:07 -0500


On Mon, 2001-12-03 at 16:16, Jeremy Siegel wrote:
> Just FYI... the preemptible kernel depends on non-preemptible critical regions
> denoted by spinlock calls (see Robert Love's excellent summary in
> Documentation/preempt-locking.txt). Many common drivers are assumed to have
> correct locking for SMP operation, but non-SMP drivers may not. I've only run
> the PreK SH kernel on the Solution Engine w/Ethernet and serial, but I did not
> yet check to see if additional locks might be required in drivers/char/sh-sci.c
> or drivers/net/stnic.c, which are specific to SH platforms and thus not SMP-safe
> otherwise.

Ahh, good point. Similar situation occured on ARM when it went
preemptive. Thankfully, Russel King and company try to properly lock
things even if they are no ops.

Coding under a preemptive kernel means more than what
Documentation/preempt-locking.txt implies ... you have to protect data
regions as if you are operating under SMP.

It is good practice, anyhow.

This means you can include linux/spinlock.h and use the locking
constructs as needed. Under a normal UP kernel, they will compile
away. Under a preemptive kernel, they will provide the needed
reentrancy protection. If there ever is a an SMP SH kernel (or
something like it) the kernel will be ready for the future.

Robert Love

-
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/