Search notes:

Kernel lock: spinlock

A spinlock is a simple single-holder lock. If the lock can not be acquired, the process keeps trying (=spinning) until it is possible.
Spinlocks are small, fast and can be used anywhere.
spinlock_t the_lock;
spinlock_init(&the_lock);

spin_lock(&the_lock);
do_something();
do_more();	
spin_unlock(&the_lock);

CONFIG_SMP and CONFIG_PREEMPT

Kernels without CONFIG_SMP and CONFIG_PREEMPT do not have spinlocks because no other process can run at the sime time anyway.
If compiled without CONFIG_SMP but with CONFIG_PREEMPT, spinlocks simply disable preemption.

See also

Kernel locks, mutexes

Index