Avoiding scheduler subversion using scheduler-cooperative locks

We introduce the scheduler subversion problem, where lock usage patterns determine which thread runs, thereby subverting CPU scheduling goals. To mitigate this problem, we introduce Scheduler-Cooperative Locks (SCLs), a new family of locking primitives that controls lock usage and thus aligns with system-wide scheduling goals; our initial work focuses on proportional share schedulers. Unlike existing locks, SCLs provide an equal (or proportional) time window called lock opportunity within which each thread can acquire the lock. We design and implement three different scheduler-cooperative locks that work well with proportional-share schedulers: a user-level mutex lock (u-SCL), a reader-writer lock (RW-SCL), and a simplified kernel implementation (k-SCL). We demonstrate the effectiveness of SCLs in two user-space applications (UpScaleDB and KyotoCabinet) and the Linux kernel. In all three cases, regardless of lock usage patterns, SCLs ensure that each thread receives proportional lock allocations that match those of the CPU scheduler. Using microbenchmarks, we show that SCLs are efficient and achieve high performance with minimal overhead under extreme workloads.

[1]  David Dice,et al.  Brief announcement: a partitioned ticket lock , 2011, SPAA '11.

[2]  Nir Shavit,et al.  Lock Cohorting , 2015, ACM Trans. Parallel Comput..

[3]  Heon Young Yeom,et al.  Performance Optimization for All Flash Scale-Out Storage , 2016, 2016 IEEE International Conference on Cluster Computing (CLUSTER).

[4]  William E. Weihl,et al.  Lottery scheduling: flexible proportional-share resource management , 1994, OSDI '94.

[5]  Michael L. Scott,et al.  Scalable reader-writer synchronization for shared-memory multiprocessors , 1991, PPOPP '91.

[6]  Vivien Quéma,et al.  Multicore Locks: The Case Is Not Closed Yet , 2016, USENIX Annual Technical Conference.

[7]  Jeff Roberson,et al.  ULE: A Modern Scheduler for FreeBSD , 2003, BSDCon.

[8]  Victor Luchangco,et al.  Scalable reader-writer locks , 2009, SPAA '09.

[9]  Anant Agarwal,et al.  Factored operating systems (fos): the case for a scalable operating system for multicores , 2009, OPSR.

[10]  Rachid Guerraoui,et al.  Lock–Unlock , 2019, ACM Trans. Comput. Syst..

[11]  Randy H. Katz,et al.  The Datacenter Needs an Operating System , 2011, HotCloud.

[12]  Y. Oyama,et al.  EXECUTING PARALLEL PROGRAMS WITH SYNCHRONIZATION BOTTLENECKS EFFICIENTLY , 1999 .

[13]  Dick H. J. Epema,et al.  An analysis of decay-usage scheduling in multiprocessors , 1995, SIGMETRICS '95/PERFORMANCE '95.

[14]  Nir Shavit,et al.  A Hierarchical CLH Queue Lock , 2006, Euro-Par.

[15]  William N. Scherer,et al.  Preemption Adaptivity in Time-Published Queue-Based Spin Locks , 2005, HiPC.

[16]  Willy Zwaenepoel,et al.  The Battle of the Schedulers: FreeBSD ULE vs. Linux CFS , 2018, USENIX Annual Technical Conference.

[17]  Rodrigo Fonseca,et al.  2DFQ: Two-Dimensional Fair Queuing for Multi-Tenant Cloud Services , 2016, SIGCOMM.

[18]  Anoop Gupta,et al.  Performance isolation: sharing and isolation in shared-memory multiprocessors , 1998, ASPLOS VIII.

[19]  Tudor David,et al.  Everything you always wanted to know about synchronization but were afraid to ask , 2013, SOSP.

[20]  Hai Jin,et al.  Optimizing Xen Hypervisor by Using Lock-Aware Scheduling , 2012, 2012 Second International Conference on Cloud and Green Computing.

[21]  Vivien Quéma,et al.  The Linux scheduler: a decade of wasted cores , 2016, EuroSys.

[22]  Eric Eide,et al.  Introducing CloudLab: Scientific Infrastructure for Advancing Cloud Architectures and Applications , 2014, login Usenix Mag..

[23]  John M. Mellor-Crummey,et al.  Contention-conscious, locality-preserving locks , 2016, PPoPP.

[24]  Erik Hagersten,et al.  Queue locks on cache coherent multiprocessors , 1994, Proceedings of 8th International Parallel Processing Symposium.

[25]  Dilma Da Silva,et al.  Experience with K42, an open-source, Linux-compatible, scalable operating-system kernel , 2005, IBM Syst. J..

[26]  David Dice,et al.  BRAVO - Biased Locking for Reader-Writer Locks , 2018, USENIX Annual Technical Conference.

[27]  Nir Shavit,et al.  Flat combining and the synchronization-parallelism tradeoff , 2010, SPAA '10.

[28]  Changwoo Min,et al.  Understanding Manycore Scalability of File Systems , 2016, USENIX Annual Technical Conference.

[29]  Jonathan Walpole,et al.  User-Level Implementations of Read-Copy Update , 2012, IEEE Transactions on Parallel and Distributed Systems.

[30]  Anant Agarwal,et al.  An operating system for multicore and clouds: mechanisms and implementation , 2010, SoCC '10.

[31]  Anees Shaikh,et al.  Performance Isolation and Fairness for Multi-Tenant Cloud Storage , 2012, OSDI.

[32]  Gadi Taubenfeld Shared Memory Synchronization , 2008, Bull. EATCS.

[33]  Michael L. Scott,et al.  Synchronization without contention , 1991, ASPLOS IV.

[34]  Nir Shavit,et al.  Flat-combining NUMA locks , 2011, SPAA '11.

[35]  Erik Hagersten,et al.  Hierarchical backoff locks for nonuniform communication architectures , 2003, The Ninth International Symposium on High-Performance Computer Architecture, 2003. HPCA-9 2003. Proceedings..

[36]  Raj Jain,et al.  A Quantitative Measure Of Fairness And Discrimination For Resource Allocation In Shared Computer Systems , 1998, ArXiv.

[37]  Lui Sha,et al.  Priority Inheritance Protocols: An Approach to Real-Time Synchronization , 1990, IEEE Trans. Computers.

[38]  Michael L. Scott,et al.  Algorithms for scalable synchronization on shared-memory multiprocessors , 1991, TOCS.

[39]  L ScottMichael,et al.  Synchronization without contention , 1991 .

[40]  Christina Delimitrou,et al.  Workload characterization of interactive cloud services on big and small server platforms , 2017, 2017 IEEE International Symposium on Workload Characterization (IISWC).

[41]  Julia L. Lawall,et al.  Fast and Portable Locking for Multicore Architectures , 2016, ACM Trans. Comput. Syst..

[42]  James H. Anderson,et al.  Spin-based reader-writer synchronization for multiprocessor real-time systems , 2010, Real-Time Systems.

[43]  David Dice,et al.  Compact NUMA-aware Locks , 2018, EuroSys.

[44]  Maurice Herlihy,et al.  Wait-free synchronization , 1991, TOPL.

[45]  Randy H. Katz,et al.  Mesos: A Platform for Fine-Grained Resource Sharing in the Data Center , 2011, NSDI.

[46]  Remzi H. Arpaci-Dusseau Operating Systems: Three Easy Pieces , 2015, login Usenix Mag..

[47]  John M. Mellor-Crummey,et al.  High performance locks for multi-level NUMA systems , 2015, PPoPP.

[48]  Thomas E. Anderson,et al.  The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors , 1990, IEEE Trans. Parallel Distributed Syst..

[49]  Robert Morris,et al.  Non-scalable locks are dangerous , 2012 .

[50]  Panagiota Fatourou,et al.  Revisiting the combining synchronization technique , 2012, PPoPP '12.

[51]  Nir Shavit,et al.  NUMA-aware reader-writer locks , 2013, PPoPP '13.

[52]  David Dice,et al.  Malthusian Locks , 2015, EuroSys.

[53]  Julia L. Lawall,et al.  Remote Core Locking: Migrating Critical-Section Execution to Improve the Performance of Multithreaded Applications , 2012, USENIX Annual Technical Conference.

[54]  Traviss. Craig,et al.  Building FIFO and Priority-Queuing Spin Locks from Atomic Swap , 1993 .

[55]  Marina Papatriantafilou,et al.  A Study of the Behavior of Synchronization Methods in Commonly Used Languages and Systems , 2013, 2013 IEEE 27th International Symposium on Parallel and Distributed Processing.

[56]  Michael Stumm,et al.  A Fair Fast Scalable Rea,der-Writer Lock , 1993, 1993 International Conference on Parallel Processing - ICPP'93.

[57]  Peter Druschel,et al.  Resource containers: a new facility for resource management in server systems , 1999, OSDI '99.