Talk type: Talk

New locks for the old kernel

  • Talk in English

Locks remain the main synchronization mechanism in userspace applications as well as in OS kernels. Despite significant progress in the design and implementation of efficient locks in userspace, kernel locks fail to keep up. Part of the reason is the unique nature of the kernel environment in which such locks are deployed. For instance, the Linux kernel requires spinlocks that use just 4 bytes of memory, significantly less than many of the modern locks need.

In this talk Alex will describe recent efforts to modernize Linux kernel locks, focusing on two concrete ideas. The first one is called CNA, which introduces a compact lock designed for efficient synchronization on multi-node machines. CNA is applied in the kernel to enhance spinlocks, one of the kernel's most important synchronization constructs. The second idea is called BRAVO, which is a wrapper intended to facilitate the scalability of reader-writer locks in mostly-read workloads without inflating the memory footprint of such locks. In the kernel, BRAVO is used to enhance the rw-semaphore, a well-known contention bottleneck for data-intensive applications.

The target audience for the talk is practitioners who have some experience with writing concurrent code that employs locks. While the focus of the talk will be on the Linux kernel, user-level application developers can benefit from the presented ideas. The key takeaways include the understanding of how some of the key synchronization mechanisms work, how they can be improved, and what are the challenges in porting ideas from user space into the kernel space.

  • #linux kernel
  • #locks
  • #numa
  • #performance

Speakers

Talks