Dear Linus, As you know we at MontaVista are working on a fully preemptable kernel. In this work we have come up with a couple of issues we would like your comments on. First, as you know, we have added code to the spinlock macros to count up and down a preemption lock counter. We would like to not do this if the macro also turns off local interrupts. The issue here is that in some places in the code, spin_lock_irq() or spin_lock_irqsave() is called but spin_unlock_irq() or spin_lock_irqrestore() is not. This, of course, confuses the preemption count. Attached is a patch that addresses this issue. At this time we are not asking you to apply this patch, but to indicate if we are moving in an acceptable direction. The second issue resolves around the naming conventions used in the kernel. We want to extend this work to include the SMP kernel, but to do this we need to have several levels of names for the spinlock macros. We note that the kernel uses "_" and "__" prefixes in some macros, but can not, by inspection, figure out when to uses these prefixes. Could you explain this convention or is this wisdom written somewhere? To clarify the intent here is a bit of proto code: #ifdef CONFIG_PREEMPT #define preempt_lock() ... definition... #define preempt_unlock() ...definition... #else #define preempt_lock() #define preempt_unlock() #endif #ifdef CONFIG_SMP #define _spin_lock(x) __spin_lock(x) /* __spin_lock(x) to be todays SMP definition */ #define _spin_unlock(x) __spin_unlock(x) /* __spin_unlock(x) to be todays SMP definition */ #else #define _spin_lock() #define _spin_unlock() #endif #define spin_lock(x) do{ preempt_lock(); _spin_lock(x);} while (0) #define spin_unlock(x) do{ _spin_unlock(x); preempt_unlock();} while (0) George