Abstract

As the number of cores equipped in a system grows, the impact of the spinlock waiting inside the operating system (OS) kernel on the performance and energy efficiency of a system worsens. In particular, it deteriorates the effectiveness of simultaneous multithreading (SMT). Because spinlocks are indispensable in OS kernels, it is necessary to suppress the spin wait overhead in the many-core systems. To address this issue, we propose the catnap spinlock that exploits the ACPI-C state, which is named as the catnap state and is induced by the MONITOR / MWAIT instruction pair. The catnap state releases the processor resources while deceiving the kernel that the thread is iterating a busy-waiting loop. Because entering and exiting from the C-state require considerable time, we applied the catnap loop only to the non-head waiters not to delay the lock handover operation. Furthermore, we selectively applied the catnap spinlock to the lock instances for sufficiently long critical sections based on the observation made in profiling runs. The proposed scheme was implemented in the Linux kernel and evaluated in a many-core processor system with a few workloads from the PARSEC and Re-aim benchmark suites. Our evaluation showed that the proposed scheme improved the performance by up to 33.59% and reduced energy consumption by 39.11%.

Highlights

  • Spinlocks have been widely used for decades because of their fast handover and lightweight design, the lock waiters consume significant processor resources while they are waiting

  • The spinlock is an essential component in the operating system (OS) kernel that guarantees the mutual exclusion property for critical sections in the scheduling or interrupt handling routines, which cannot be preempted, or for the extremely short critical sections

  • We quantitatively analyzed the impact of the kernel-internal spinlocks on the performance and energy efficiency of an simultaneous multithreading (SMT)-featured many-core system and proposed the catnap spinlock to resolve it

Read more

Summary

INTRODUCTION

Spinlocks have been widely used for decades because of their fast handover and lightweight design, the lock waiters consume significant processor resources while they are waiting. To address the increased spinning overhead in the many-core systems, this paper proposes catnap spinlock for the OS kernel. The MONITOR/MWAIT instruction pair enables spinlock waiting without resource waste, but the idling core requires notable time to wake up from the low power state. To minimize the handover delay caused by the catnap state, we apply the catnap waiting loop only to the non-head waiters, which are expected not to acquire the lock right next to the current holder. Based on the profile results, we selectively applied the catnap spinlock to the kernel instances that have critical sections longer than the harmless catnap threshold, which is the minimum length of the critical section that can hide the wake-up delay in the proposed design.

BACKGROUND
RELATED WORK
CONCLUSION
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call