Queue Spinlocks Coming For Linux 4.2 Kernel
Waiman Long of HP has been spearheading qspinlocks now for the past several months and with Linux 4.2 the queue spinlocks support will be merged.
Long explained the queue-based spinlock implementation, "The queue spinlock has slight better performance than the ticket spinlock in uncontended case. Its performance can be much better with moderate to heavy contention. This patch has the potential of improving the performance of all the workloads that have moderate to heavy spinlock contention. The queue spinlock is especially suitable for NUMA machines with at least 2 sockets, though noticeable performance benefit probably won't show up in machines with less than 4 sockets. The purpose of this patch set is not to solve any particular spinlock contention problems. Those need to be solved by refactoring the code to make more efficient use of the lock or finer granularity ones. The main purpose is to make the lock contention problems more tolerable until someone can spend the time and effort to fix them."
The qspinlock patches have undergone several revisions over the months and with Linux 4.2 will be enabled by default on x86 platforms as they are outperforming the ticket spinlocks for all categories. This work is coming via the locking changes and in addition to qspinlock is a pvqspinlock for para-virtualized queued spinlocks and qrwlock as queued rwlocks similar to qspinlocks.
Long explained the queue-based spinlock implementation, "The queue spinlock has slight better performance than the ticket spinlock in uncontended case. Its performance can be much better with moderate to heavy contention. This patch has the potential of improving the performance of all the workloads that have moderate to heavy spinlock contention. The queue spinlock is especially suitable for NUMA machines with at least 2 sockets, though noticeable performance benefit probably won't show up in machines with less than 4 sockets. The purpose of this patch set is not to solve any particular spinlock contention problems. Those need to be solved by refactoring the code to make more efficient use of the lock or finer granularity ones. The main purpose is to make the lock contention problems more tolerable until someone can spend the time and effort to fix them."
The qspinlock patches have undergone several revisions over the months and with Linux 4.2 will be enabled by default on x86 platforms as they are outperforming the ticket spinlocks for all categories. This work is coming via the locking changes and in addition to qspinlock is a pvqspinlock for para-virtualized queued spinlocks and qrwlock as queued rwlocks similar to qspinlocks.
2 Comments