Spin locks are a means of providing mutual exclusion between (primarily) different CPU cores in an SMP environment. In some cases they may also provide mutual exclusion between interrupt service routines and other threads or processes which are operating 'inside scheduler space'. As you point out, they do not sleep. They simply spin in place until either another CPU core releases the lock or until the spinning thread is preempted by another thread (for example an ISR) which currently holds the lock on the same core.
The PREEMPT_RT_FULL kernel changes most spin locks into rt_mutexes, which wait for shared resources on a priority basis and provide priority inheritance. However, rt_mutexes put the waiting thread or process to sleep until it obtains the requested lock. Threads running in contexts outside the scheduler (in interrupt context) or running inside 'critical sections' during which preemption is disabled are prohibited from sleeping since the scheduler cannot awaken them. For this reason, in the PREEMPT_RT_FULL kernel there is a distinction made between 'spin locks' and 'raw spin locks'. The former are transformed into priority-based sleeping locks, while the 'raw spin locks' remain unchanged and retain their traditional non-sleeping wait behavior. This allows raw spin locks to be used inside critical sections and outside of 'scheduler space'.
Gary Robertson