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

Boris Teabe, Vlad Nitu, A. Tchana, D. Hagimont
{"title":"The lock holder and the lock waiter pre-emption problems: nip them in the bud using informed spinlocks (I-Spinlock)","authors":"Boris Teabe, Vlad Nitu, A. Tchana, D. Hagimont","doi":"10.1145/3064176.3064180","DOIUrl":null,"url":null,"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.","PeriodicalId":262089,"journal":{"name":"Proceedings of the Twelfth European Conference on Computer Systems","volume":"19 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-04-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"17","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the Twelfth European Conference on Computer Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3064176.3064180","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 17

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.
锁持有人和锁服务员抢占问题:使用知情自旋锁(I-Spinlock)将它们扼杀在萌芽状态。
在本地Linux系统中,自旋锁的实现依赖于锁持有线程和锁等待线程都不能被抢占的假设。但是,在虚拟化环境中,这些线程被调度在虚拟CPU (vCPU)之上,虚拟CPU可以随时被hypervisor抢占,从而迫使其他vCPU上的锁等待线程忙于等待并浪费CPU周期。这就导致了众所周知的锁持有人抢占(LHP)和锁等待者抢占(LWP)问题。在本文中,我们提出了I-Spinlock (Informed Spinlock),这是一种用于虚拟化环境的新的自旋锁实现。它的主要原则是,只有当且仅当它的vCPU的剩余时间片足够进入和离开临界区时,才允许线程获得锁。如果自旋锁原语(由管理程序)知道(通知)它的抢占时间,这是可能的。我们在Xen虚拟化系统中实现了I-Spinlock。我们展示了我们的解决方案兼容准虚拟和硬件虚拟化模式。我们使用各种参考基准执行了广泛的性能评估,并将我们的解决方案与以前的解决方案进行了比较。评估表明,I-Spinlock优于其他解决方案,并且当岩心数量增加时更为显著。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信