skip to main content
10.1145/3064176.3064180acmconferencesArticle/Chapter ViewAbstractPublication PageseurosysConference Proceedingsconference-collections
research-article

The lock holder and the lock waiter pre-emption problems: nip them in the bud using informed spinlocks (I-Spinlock)

Published: 23 April 2017 Publication History

Abstract

In native Linux systems, spinlock's implementation relies on the assumption that both the lock holder thread and lock waiter threads cannot be preempted. However, in a virtualized environment, these threads are scheduled on top of virtual CPUs (vCPU) that can be preempted by the hypervisor at any time, thus forcing lock waiter threads on other vCPUs to busy wait and to waste CPU cycles. This leads to the well-known Lock Holder Preemption (LHP) and Lock Waiter Preemption (LWP) issues.
In this paper, we propose I-Spinlock (for Informed Spinlock), a new spinlock implementation for virtualized environments. Its main principle is to only allow a thread to acquire a lock if and only if the remaining time-slice of its vCPU is sufficient to enter and leave the critical section. This is possible if the spinlock primitive is aware (informed) of its time-to-preemption (by the hypervisor).
We implemented I-Spinlock in the Xen virtualization system. We show that our solution is compliant with both para-virtual and hardware virtualization modes. We performed extensive performance evaluations with various reference benchmarks and compared our solution to previous solutions. The evaluations demonstrate that I-Spinlock outperforms other solutions, and more significantly when the number of core increases.

References

[1]
P. M. Wells, K. Chakraborty, G. S. Sohi, "Hardware support for spin management in overcommitted virtual machines," Proceedings of the 15th international conference on Parallel architectures and compilation techniques (PACT), 2006.
[2]
V. Uhlig, J. LeVasseur, E. Skoglund, U. Dannowsk, "Towards Scalable Multiprocessor Virtual Machines," Proceedings of the 3rd conference on Virtual Machine Research And Technology Symposium (VM), 2004
[3]
T. Friebel, "How to deal with lock-holder preemption," Presented at the Xen Summit North America, 2008.
[4]
K. Raghavendra, J. Fitzhardinge, "Paravirtualized ticket spinlocks," May 2012
[5]
J. Ouyang, J. R. Lange, "Preemptable Ticket Spinlocks: Improving Consolidated Performance in the Cloud," Proceedings of the 9th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments (VEE), 2013
[6]
J.Ouyang, "https://lwn.net/Articles/556141/,"
[7]
S. Kashyap, C. Min, T. Kim, "Opportunistic Spinlocks: Achieving Virtual Machine Scalability in the Clouds," ACM SIGOPS Operating Systems Review, 2016
[8]
J. Ousterhout, "Scheduling techniques for concurrent systems," IEE Distributed computer System, 1982
[9]
VMware, "I. Vmware(r) vsphere(tm): The cpu scheduler in vmware esx(r) 4.1," 2010
[10]
J. Ahn, C. H. Park, J. Huh, "Micro-Sliced Virtual Processors to Hide the Effect of Discontinuous CPU Availability for Consolidated Systems," Proceedings of the 47th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), 2014
[11]
T. Boris, A. Tchana, D. Hagimont, "Application-specific quantum for multi-core platform scheduler," Proceedings of the Eleventh European Conference on Computer Systems (Eurosys), 2016
[12]
J. Corbet, "https://lwn.net/Articles/267968/,"
[13]
y-cruncher: A Multi-Threaded Pi-Program, "http://www.numberworld.org/y-cruncher/"
[14]
J. Gilchrist, "http://compression.ca/pbzip2/," 2015
[15]
bzip2, "http://www.bzip.org/," 2015
[16]
R. Love, "Linux Kernel Development, Third edition," 2005
[17]
Kernbench, "http://freecode.com/projects/kernbench," 2009
[18]
Ebizzy, "http://sourceforge.net/projects/ebizzy/," 2009
[19]
Intel, "Intel 64 and IA-32 Architectures Software Developers Manual, Software Developers Manual, Intel, 2010.
[20]
K. T. Raghavendra, "Virtual Cpu Scheduling Techniques for Kernel Based Virtual Machine (Kvm)," Proceeding of the Cloud Computing in Emerging Markets (CCEM) 2013
[21]
O. Sukwong, H. S. Kim, "Is co-scheduling too expensive for smp vms," Proceedings of the Eleventh European Conference on Computer Systems (Eurosys), 2011
[22]
Credit Scheduler, "http://wiki.xen.org/wiki/Credit Scheduler", consulted on September 2015
[23]
The CPU Scheduler in VMware vSphere 5.1, "https://www.vmware.com/files/pdf/techpaper/VMware-vSphere-CPU-Sched-Perf.pdf,"
[24]
J. M. Mellor-Crummey, M. L. Scott "Algoritms for scalable Synchronization on Shared-Memory Multiprocessors", ACM Transactions on Computer Systems (TOCS), 1991
[25]
S. Wu, Z. Xie, H. Chen, S. Di, X. Zhao, H. Jin "Dynamic Acceleration of Parallel Applications in Cloud Platforms by Adaptive Time-Slice Control", IEEE International Parallel and Distributed Processing Symposium (IPDPS), 2016
[26]
C. Weng, Q. Liu, L. Yu, and Minglu, "Dynamic Adaptive Scheduling for Virtual Machines," Proceedings of the 20th international symposium on High performance distributed computing (HPDC), 2013
[27]
A. Menon, J. R. Santos, Y. Turner, "Diagnosing Performance Overheads in the Xen Virtual Machine Environment", Proceedings of the second ACM SIGPLAN/SIGOPS international conference on Virtual execution environments (VEE), 2005
[28]
Mckenney, PE. Appavoo, J. Kleen, A. Krieger, O. Russel, R. Sarma and Soni, "Read-Copy Update," In Ottawa Linux Symposium (OLS), 2002
[29]
MCS locks and qspinlocks, "https://lwn.net/Articles/590243/," 2014
[30]
X. Ding, Phillip, B. Gibbons and M. Kozuch, J. Shan, "Gleaner: Mitigating the Blocked-Waiter Wakeup Problem for Virtualized Multicore Applications," Proceedings of the 2014 USENIX conference on USENIX Annual Technical Conference (ATC), 2014
[31]
P. Barham, B. Dragovic, K. Fraser, S. Hand, T. Harris, Alex Ho, R. Neugebauer, I. Pratt, A. Warfield, "Xen and the art of virtualization," Proceedings of the nineteenth ACM symposium on Operating systems principles Pages (SOSP) 2003
[32]
D. Marsh, L. Scott, J. LeBlanc, P. Markatos, "First-Class User-Level Threads," Proceedings of the Thirteenth ACM symposium on Operating systems principles Pages (SOSP) 1991

Cited By

View all
  1. The lock holder and the lock waiter pre-emption problems: nip them in the bud using informed spinlocks (I-Spinlock)

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    EuroSys '17: Proceedings of the Twelfth European Conference on Computer Systems
    April 2017
    648 pages
    ISBN:9781450349383
    DOI:10.1145/3064176
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 23 April 2017

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. multi-core
    2. scheduler
    3. spinlocks
    4. virtual machine

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    EuroSys '17
    Sponsor:
    EuroSys '17: Twelfth EuroSys Conference 2017
    April 23 - 26, 2017
    Belgrade, Serbia

    Acceptance Rates

    Overall Acceptance Rate 241 of 1,308 submissions, 18%

    Upcoming Conference

    EuroSys '25
    Twentieth European Conference on Computer Systems
    March 30 - April 3, 2025
    Rotterdam , Netherlands

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)35
    • Downloads (Last 6 weeks)4
    Reflects downloads up to 16 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media