tScale: A Contention-Aware Multithreaded Framework for Multicore Multiprocessor Systems

On the multicore and multiprocessor system, multithreaded applications which are kernel-intensive usually suffer from two kinds of performance issues, first one is frequent context switch between kernel/user mode. Another one is lock contention caused by non-scalable synchronization primitives (e.g., ticket spin lock) and may even result in performance degradation under heavy contention level. Unfortunately, current Linux threading model (i.e., NPTL) which adopts exception-based system call mechanism fails to reduce the excessive system call cost. Besides, conventional threading scheduler which is unconscious of lock contention also lacks the ability to limit the number of system-wide contending parallel threads. Both of them impede the application's throughput increment and may lead to the performance breakdown eventually. In this paper we propose a contention-aware threading framework to alleviate these two problems. Our proposed design is composed of two tightly contected components: system call batching via user-level thread library and a contention-aware scheduler based on non-work-conserving scheduling policy. The user-level threading library gathers multiple system call invocations transparently and deliverys these requests to the underlaying kernel working threads. Therefore, tScale improves application performance by reducing massive context switch cost. Then through continuing monitoring system-wide lock contention level and application's total throughput increment, tScale can quickly adjust the number of contending threads in order to sustain the maximum throughput. The prototype system is implemented on Linux 3.18.30 and Glibc 2.23. In microbenchmarks on a 32-core machine, experiment results show that our approach can not only improve the application throughput by up to 20% but also address the lock contention efficiently.

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

[2]  Robert Tappan Morris,et al.  An Analysis of Linux Scalability to Many Cores , 2010, OSDI.

[3]  Laxmi N. Bhuyan,et al.  Shuffling: A framework for lock contention aware thread scheduling for multicore multiprocessor systems , 2014, 2014 23rd International Conference on Parallel Architecture and Compilation (PACT).

[4]  Haibo Chen,et al.  Scalable Adaptive NUMA-Aware Lock , 2017, IEEE Transactions on Parallel and Distributed Systems.

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

[6]  Giuseppe Serazzi,et al.  Analysis of Non-Work-Conserving Processor Partitioning Policies , 1995, JSSPP.

[7]  Haibo Chen,et al.  Scalable Read-mostly Synchronization Using Passive Reader-Writer Locks , 2014, USENIX Annual Technical Conference.

[8]  Alexandra Fedorova,et al.  Addressing shared resource contention in multicore processors via scheduling , 2010, ASPLOS XV.

[9]  Yan Cui,et al.  Requester-Based Spin Lock: A Scalable and Energy Efficient Locking Scheme on Multicore Systems , 2015, IEEE Transactions on Computers.

[10]  Michael Stumm,et al.  FlexSC: Flexible System Call Scheduling with Exception-Less System Calls , 2010, OSDI.

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

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

[13]  Margo Seltzer,et al.  A Non-Work-Conserving Operating System Scheduler For SMT Processors , 2006 .

[14]  Stephen. D. J. Gwyn,et al.  MegaPipe: The MegaCam Image Stacking Pipeline at the Canadian Astronomical Data Centre , 2007, 0710.0370.

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

[16]  Yan Cui,et al.  Lock-contention-aware scheduler: A scalable and energy-efficient method for addressing scalability collapse on multicore systems , 2013, TACO.