linux 并发 RCU

What is RCU, Fundamentally?

https://lwn.net/Articles/262464/

If you can fill the unforgiving second
with sixty minutes worth of distance run,
“Highly scalable” your code will be reckoned,
And—which is more—you‘ll have parallel fun!

With apologies to Rudyard Kipling.

SMP Scalability Papers

    1. Linux-Kernel Memory Ordering: Help Arrives At Last!, with Jade Alglave, Luc Maranget, Andrea Parri, and Alan Stern, Linux Kernel Summit Track. (Additional litmus tests here.) November 2016.
    2. Linux-Kernel Memory Ordering: Help Arrives At Last!, with Jade Alglave, Luc Maranget, Andrea Parri, and Alan Stern, LinuxCon EU. October 2016.
    3. High-Performance and Scalable Updates: The Issaquah Challenge, guest lecture to the Distributed Operating Systems class at TU Dresden (video), June 2016.
    4. Practical Experience With Formal Verification Tools at Beaver BarCamp, Corvallis, Oregon USA, April 2016.
    5. Practical Experience With Formal Verification ToolsVerified Trustworthy Software Systems Specialist Meeting, April 2016.
    6. Linux-Kernel Community Validation Practices, The Royal Society Verified Trustworthy Software Systems Meeting, “Verification in Industry” discussion, April 2016.
    7. Formal Verification and Linux-Kernel Concurrency, guest lecture to the CS569 class at Oregon State University, June 2015.
    8. Formal Verification and Linux-Kernel Concurrency, guest lecture to the CS362 class at Oregon State University, June 2015. (AKA “what would have to happen for me to add formal verification to Linux-kernel RCU‘s regression test suite?”)
    9. High-Performance and Scalable Updates: The Issaquah Challenge, guest lecture to the Distributed Operating Systems class at TU Dresden (video), June 2015.
    10. Formal Verification and Linux-Kernel Concurrency at Beaver BarCamp, Corvallis, Oregon USA, April 2015.
    11. Creating scalable APIs, in Linux Weekly News, August 2014.
    12. High-Performance and Scalable Updates: The Issaquah Challenge at linux.conf.au in Auckland, January 2015.
    13. Bare-Metal Multicore Performance in a General-Purpose Operating System (Adventures in Ubiquity) at linux.conf.au in Auckland, January 2015.
    14. Use Cases for Thread-Local Storage ISO SC22 WG21 (C++ Language), November 2014. (revised N4376 2015-02-06).
    15. Linux-Kernel Memory Model ISO SC22 WG21 (C++ Language), November 2014. Official version: N4216 (revised N4374 2015-02-06).
    16. Axiomatic validation of memory barriers and atomic instructions, in Linux Weekly News, August 2014.
    17. Out-of-Thin-Air Execution is Vacuous ISO SC22 WG21 (C++ Language), May 2014. Official version: N4216 (revised N4323 2014-11-20revised N4375 2015-02-06).
    18. Reordering and Verification at the Linux Kernel REORDER workshop in Vienna Summer of Logic, July 2014.
    19. But What About Updates? Guest lecture to Portland State University CSE510 (Concurrency), Prof. Jonathan Walpole, June 2014.
    20. N4037: Non-Transactional Implementation of Atomic Tree Move ISO SC22 WG21 (C++ Language), May 2014.
    21. Bare-Metal Multicore Performance in a General-Purpose Operating System (Now With Added Energy Efficiency!) at Beaver BarCamp, Corvallis, OR, USA, April 2014.
    22. Bare-Metal Multicore Performance in a General-Purpose Operating System (Now With Added Energy Efficiency!) at Linux Collaboration Summit, Napa, CA, USA, March 2014.
    23. But What About Updates? at Linux Collaboration Summit, Napa, CA, USA, March 2014.
    24. Bare-Metal Multicore Performance in a General-Purpose Operating System (Now With Added Energy Efficiency!) at linux.conf.au in Perth, January 2014.
    25. Advances in Validation of Concurrent Software at linux.conf.au in Perth, January 2014.
    26. Scaling Talks at Linux Kernel Summit Scaling microconference October 2013.
    27. But What About Updates? at Linux Plumbers Conference Scaling microconference, New Orleans, LA, USA. September 2013.
    28. Bare-Metal Multicore Performance in a General-Purpose Operating System (Now With Added Energy Efficiency!) at Linux Plumbers Conference, New Orleans, LA, USA. September 2013.
    29. Advances in Validation of Concurrent Software at Linux Plumbers Conference, New Orleans, LA, USA. September 2013.
    30. Beyond Expert-Only Parallel Programming? at LinuxCon North America, New Orleans, LA, USA. September 2013.
    31. Bare-Metal Multicore Performance in a General-Purpose Operating System at Linux Foundation Enterprise End User Summit, May 2013.
    32. Bare-Metal Multicore Performance in a General-Purpose Operating System at Multicore World, February 2013. (Updated for Oregon State University BarCamp, April 2013.)
    33. January 2013 Validating Core Parallel Software? at linux.conf.au Open Programming Miniconference.
    34. Beyond Expert-Only Parallel Programming? (presentation), at the Workshop on Relaxing Synchronization for Multicore and Manycore Software (RACES‘12), October 2012.
    35. Scheduling and big.LITTLE Architecture, at Scheduling Microconference, Linux Plumbers Conference, August 2012.
    36. Signed overflow optimization hazards in the kernel, in Linux Weekly News, August 2012.
    37. Validating Core Parallel Software, at Linux Collaboration Summit, San Francisco, CA, USA, April 2012.
    38. Validating Memory Barriers and Atomic Instructions, in Linux Weekly News, December 2011.
    39. Validating Core Parallel Software, at TU Dresden, Germany, October 2011.
    40. Validating Core Parallel Software, at the 2011 China Linux Kernel Developer Conference, Nanjing, China, October 2011. (Invited)
    41. Is Parallel Programming Hard, And If So, What Can You Do About It?, at the 2011 Android System Developer Forum, Taipei, Taiwan, April 2011. (Invited)
    42. Verifying Parallel Software: Can Theory Meet Practice?, at Verification of Concurrent Data Structures (Verico), Austin, TX, USA, January 2011. (Invited)
    43. Concurrent code and expensive instructions, Linux Weekly News, January 2011.
    44. Is Parallel Programming Hard, And, If So, Why?, linux.conf.au January 2011.
    45. Verifying Parallel software: Can Theory Meet Practice?, linux.conf.au January 2011.
    46. Multi-Core Memory Models and Concurrency Theory: A View from the Linux Community, Dagstuhl workshop January 2011.
    47. N1525: Memory-Order Rationale with Blaine Garst (revised). ISO SC22 WG14 (C Language), November 2010.
    48. Omnibus Memory Model and Atomics Paper, ISO SC22 WG21 (C++ Language), with Mark Batty, Clark Nelson, Hans Boehm, Anthony Williams, Scott Owens, Susmit Sarkar, Peter Sewell, Tjark Weber, Michael Wong, Lawrence Crowl, and Benjamin Kosnik. August 2010. Updated November 2010,
    49. Scalable concurrent hash tables via relativistic programming, August 2010, with Josh Triplett and Jonathan Walpole.
    50. Why the grass may not be greener on the other side: a comparison of locking vs. transactional memory, August 2010, with Maged M. Michael, Josh Triplett, and Jonathan Walpole.
    51. Synchronization and Scalability in the Macho Multicore Era, Scuola Superiore Sant‘Anna, Pisa, Italy, July 2010.
    52. Additional Atomics Errata. ISO SC22 WG14 (C Language), May 2010.
    53. Additional Atomics Errata, complete with typo in title. ISO SC22 WG14 (C Language), May 2010.
    54. Rationale for C-Language Dependency Ordering. ISO SC22 WG14 (C Language), May 2010.
    55. Updates to C++ Memory Model Based on Formalization. ISO SC22 WG14 (C Language), April 2010. Updated May 2010.
    56. Explicit Initializers for Atomics. ISO SC22 WG14 (C Language), April 2010. Updated May 2010.
    57. Dependency Ordering for C Memory Model. ISO SC22 WG14 (C Language), April 2010.
    58. Explicit Initializers for Atomics. ISO SC22 WG21 (C++ Language) March 2010.
    59. Updates to C++ Memory Model Based on Formalization. ISO SC22 WG21 (C++ Language) February 2010. Updated March 2010.
    60. Dependency Ordering for C Memory Model. ISO SC22 WG14 (C Language) November 2009.
    61. Updates to C++ Memory Model Based on Formalization. ISO SC22 WG14 (C Language) October 2009.
    62. Performance, Scalability, and Real-Time Response From the Linux Kernel short course for ACACES 2009.
    63. Is Parallel Programming Hard, and If So, Why?, presented at January 2009 linux.conf.au, along with corresponding Portland State University technical report.
    64. Example POWER Implementation for C/C++ Memory Model, revision of ISO WG21 N2745. ISO SC22 WG21 (C++ Language) September 2008. This mapping was proven to be pointwise locally optimal in 2012 byBatty, Memarian, Owens, Sarkar, and Sewell of University of Cambridge. In other words, to improve on this mapping, it is necessary to consider successive atomic operations: Taken one at a time, each is optimal.
    65. Concurrency and Race Conditions at Linux Plumbers Conference Student Day, September 2008.
    66. After 25 Years, C/C++ Understands Concurrency at linux.conf.au 2008 Mel8ourne. February 2008.
    67. Comparison of locking and transactional memory and presentation at PLOS 2007 with Maged Michael and Jon Walpole. October 2007. (revised presentation.) (Official version of paper.)
    68. C++0x memory model user FAQ with Hans Boehm, August 2007.
    69. C++ Data-Dependency Ordering: Atomics (Updated), C++ Data-Dependency Ordering: Memory Model (Updated), and C++ Data-Dependency Ordering: Function Annotation (Updated). August 2007. (Updated version of the May 2007 paper.)
    70. C++ Data-Dependency Ordering. May 2007.
    71. A simple and efficient memory model for weakly ordered architectures. Makes case for weakly ordered primitives in programming languages. Updated May 2007.
    72. Overview of Linux-Kernel Reference Counting. January 2007.
    73. Memory Ordering in Modern Microprocessors, appearing in two parts in the August and September 2005 Linux Journal (revised April 2009).
    74. Storage Improvements for 2.6 and 2.7 in August 2004 Linux Journal.
    75. Linux Kernel Scalability: Using the Right Tool for the Job. Presentation on scalability given at the 2004 Ottawa Linux Symposium and revised for the 2005 linux.conf.au.
    76. Issues with Selected Scalability Features of the 2.6 Kernel OLS paper describing scalability, DoS, and realtime limitations of the Linux kernel at that time. With Dipankar Sarma.
    77. Fairlocks--a High-Performance Fair Locking Scheme Bit-vector fair locking scheme for NUMA systems. Revision of paper that appeared in 2002 Parallel and Distributed Computing and Systems, with Swaninathan Sivasubramanian, Jack F. Vogel, and John Stultz. Of course, it is even better to design your software so that lock contention is low enough that fancy locking techniques don‘t help! We implemented a number of variations on this theme.
    78. Practical Performance Estimation On Shared-Memory Multiprocessors (bibtex). The silver lining of the memory-latency dark cloud--programs whose run time is dominated by memory latency are often amenable to simple performance-estimation methods. Some of these methods are applicable at design time. Revision of PDCS‘99 paper.
    79. Differential Profiling (bibtex). Revised version of the MASCOTS‘95 and the ‘99 SP&E papers.
    80. Experience With an Efficient Parallel Kernel Memory Allocator (bibtex). Revised version of the W‘93 USENIX and 2001 SP&E papers.
    81. Selecting Locking Designs for Parallel Programs (bibtex). Revised version of the PLoPD-II paper.
    82. Selecting Locking Primitives for Parallel Programs (bibtex). Revised version of the October ‘96 CACM paper.
    83. Efficient Demultiplexing of Incoming TCP Packets (bibtex). Analytic comparison of a number of demultiplexing techniques. The winner is hashing.
    84. Stochastic Fairness Queueing (bibtex). High-speed approximate implementation of Fair Queueing.
    85. High-Speed Event-Counting and -Classification Using a Dictionary Hash Technique (bibtex). Revised version of the ICPP‘89 paper.
    86. Bibtex for other papers
      1. Introduction to RCU

        The best introduction to RCU is my Linux Weekly News three-part series, with update:

        1. What is RCU, Fundamentally? with Jonathan Walpole (bibtex).
        2. What is RCU? Part 2: Usage (bibtex).
        3. RCU part 3: the RCU API (bibtex).
        4. The RCU API, 2010 Edition.

        These expand on the older “What is RCU?” introduction. The Wikipedia article also has some good information, as does the ACM Queue article. In addition, Linux Weekly News has a long list of RCU-related articles.

        There is also some research on the general family of algorithms of which RCU is a member (bibtex) and an annotated bibliography. Alexey Gotsman, Noam Rinetzky, and Hongseok Yang have produced aformalization of RCU based on separation logic.

        How much is RCU used in the Linux kernel?

        Implementing RCU

        The following papers describe how to implement RCU, in roughly increasing order of accessibility:

        1. Lockdep-RCU.
        2. RCU: The Bloatwatch Edition (optimized for uniprocessor operation) (bibtex).
        3. Sleepable Read-Copy Update (SRCU), revision of Linux Weekly News article (bibtex).
        4. The classic PDF revision of PDCS‘98 paper on DYNIX/ptx‘s RCU implementation (bibtex).
        5. The February 2012 IEEE TPDS paper (bibtex) is the best source of information on what RCU is, how to implement it in userspace, and how it performs. The pre-publication accepted version of this paper may be found here (main paper) and here (supplementary materials). Some of the material in this paper came from Mathieu Desnoyers‘s Ph.D. dissertation (bibtex).
        6. Using Promela and Spin to verify parallel algorithms at Linux Weekly News (bibtex). Includes description of QRCU implementation.
        7. My Ph.D. dissertation on RCU, which includes descriptions of a number of early implementations (bibtex).
        8. The design of preemptable read-copy update (Linux Weekly News article) (bibtex). Please be warned: this is a detailed design document of the most complex known RCU implementation. This implementation has since been replaced by a faster, simpler, and more scalable implementation, and an update of the documentation is pending.

        There is an RCU to-do list that is updated sporadically.

        Read-Copy Update (RCU) Papers

        A more-complete list in reverse chronological order:

        1. October 2016 Tracing and Linux-Kernel RCU at Tracing Summit.
        2. September 2016 A lock-free concurrency toolkit for deferred reclamation and optimistic speculation at CPPCON, with Michael Wong and Maged Michael (video).
        3. September 2016 RCU and C++ at CPPCON (video).
        4. September 2016 Beyond the Issaquah Challenge: High-Performance Scalable Complex Updates at CPPCON.
        5. June 2016 High-Performance and Scalable Updates: The Issaquah Challenge, at ACM Applicative Conference.
        6. February 2016 What Happens When 4096 Cores All Do synchronize_rcu_expedited()?, at linux.conf.au.
        7. February 2016 Mutation Testing and RCU, at linux.conf.au Kernel Miniconf.
        8. September 2015 C++ Atomics: The Sad Story of memory_order_consume A Happy Ending At Last?at CPPCON.
        9. July-August 2015 Requirements for RCU part 1: the fundamentalsRCU requirements part 2 — parallelism and software engineering, and RCU requirements part 3, Linux Weekly News.
        10. May 2015 Dagstuhl Seminar 15191 “Compositional Verification Methods for Next-Generation Concurrency”:
          1. Formal Verification and Linux-Kernel Concurrency
          2. Linearizability: Who Really Needs It?
          3. Some Examples of Kernel-Hacker Informal Correctness Reasoning

          Blog post.

        11. November 2014 Recent read-mostly research, Linux Weekly News.
        12. November 2014 Read-Copy Update (RCU) Validation and Verification for Linux Galois Tech Talk.
        13. September 2014 C++ Memory Model Meets High-Update-Rate Data Structures CPPCON.
        14. September 2014 The RCU API, 2014 Edition, Linux Weekly News.
        15. May 2014 Towards Implementation and Use of memory_order_consume ISO SC22 WG21 (C++ Language) Official version: (N4036) (revised N4215 2014-10-05revised N4321 2014-11-20).
        16. May 2014 Non-Transactional Implementation of Atomic Tree Move (4037) ISO SC22 WG21 (C++ Language).
        17. May 2014 What Is RCU?, presented to TU Dresden Distributed OS class (Instructor Carsten Weinhold).
        18. November 2013 User-space RCU, Linux Weekly News, with Mathieu Desnoyers, Lai Jiangshan, and Josh Triplett. Subparts of this article are: URCU-protected hash tablesThe URCU hash table APIURCU-protected queues and stacksThe URCU stack/queue APIUser-space RCU: Atomic-operation and utility APIUser-space RCU: Memory-barrier menagerieThe user-space RCU APIThe RCU-protected list APIThe RCU-barrier menagerie,
        19. November 2013 What Is RCU?, guest lecture to University of Cambridge (Prof. Peter Sewell).
        20. October 2013 Introduction to RCU Concepts: Liberal application of procrastination for accommodation of the laws of physics — for more than two decades, LinuxCon Europe 2013 (part of Mathieu Desnoyers‘s Hands-On Tutorial on Scalability with Userspace RCU).
        21. May 2013 What Is RCU?, presented to TU Dresden Distributed OS class (Prof. Hermann Härtig).
        22. May 2013 What Is RCU? (video), presented to Indian Institute of Science (IISc) (Prof. K. Gopinath).
        23. May 2013 Structured Deferral: Synchronization via Procrastination, ACM Queue.
        24. January 2013 What is RCU?The SIGPLAN Programming Languages Mentoring Workshop.
        25. August 2012 Real-Time Response on Multicore Systems: It Is Bigger Than You Think, Scaling Microconference, Linux Plumbers Conference.
        26. May 2012 What Is RCU? presented to TU Dresden Distributed OS class (Prof. Hermann Härtig).
        27. February 2012 Making RCU Safe For Battery-Powered Devices presented to the Embedded Linux Conference.
        28. February 2012 User-Level Implementations of Read-Copy Update (bibtex) covering what RCU is, how to implement it in userspace, and how it performs. The pre-publication accepted version of this paper may be found here (main paper) and here (supplementary materials).
        29. July 2011 3.0 and RCU: what went wrong.
        30. December 2010 The RCU API, 2010 Edition.
        31. August 2010 Scalable Concurrent Hash Tables via Relativistic Programming (bibtex).
        32. February 2010 Lockdep-RCU describing software-engineering enhancements to the Linux-kernel RCU implementations (bibtex).
        33. January 2010 Simplicity Through Optimization (presentation) (bibtex).
        34. January 2009 Using a Malicious User-Level RCU to Torture RCU-Based Algorithms, at linux.conf.au (bibtex). Describes several user-level RCU implementations, and describes how they can be used to validate kernel-level code using RCU.
        35. November 2008 Hierarchical RCU, in Linux Weekly News (bibtex). Describes a Linux-kernel RCU implementation designed to scale to thousands of CPUs.
        36. July 2008 Introducing technology into the Linux kernel: a case study in ACM SIGOPS Operating System Review, with Jon Walpole (updated to include RCU changes through the 2.6.36 Linux kernel) (bibtex).
        37. May 2008 The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with Linux in IBM Systems Journal, with Dinakar Guniguntala, Josh Triplett, and Jon Walpole (bibtex).
        38. February 2008 Introducing Technology into Linux (bibtex), or "Introducing your technology into Linux will require intoducing a LOT of Linux into your technology!!!" at the 2008 Linux Developer Symposium - China (revised). (Chinese translation of original.)
        39. January 2008 RCU part 3: the RCU APIat Linux Weekly News (bibtex).
        40. December 2007 What is RCU? Part 2: Usageat Linux Weekly News (bibtex).
        41. December 2007 What is RCU, Fundamentally?at Linux Weekly News with Jonathan Walpole (bibtex).
        42. December 2007 Performance of Memory Reclamation for Lockless Synchronization in the Journal of Parallel and Distributed Computing, with Tom Hart, Angela Demke Brown, and Jonathan Walpole (bibtex). (Journal version of the IPDPS‘06 paper.)
        43. October 2007 The design of preemptable read-copy update at Linux Weekly News (bibtex).
        44. August 2007 Using Promela and Spin to verify parallel algorithms at Linux Weekly News (bibtex). Includes proof of correctness for QRCU.
        45. February 2007 "Priority-Boosting RCU Read-Side Critical Sections", revision of earlier Linux Weekly News version (bibtex).
        46. October 2006 "Sleepable Read-Copy Update", revision of earlier Linux Weekly News version (bibtex).
        47. July 2006 "Extending RCU for Realtime and Embedded Workloads" with Dipankar Sarma, Ingo Molnar, and Suparna Bhattacharya at OLS‘2006 (bibtex), and corresponding presentation.
        48. April 2006 "Making Lockless Synchronization Fast: Performance Implications of Memory Reclamation", with Tom Hart and Angela Demke. IPDPS 2006 Best PaperPaper (bibtex). Presentation.
        49. July 2005 Abstraction, Reality Checks, and RCU presented at University of Toronto‘s "Cider Seminar" series (abstract).
        50. April 2005 paper (revised) and presentation describing Linux realtime and yet more modifications to RCU to enable even more aggressive realtime response (bibtex). Presented at the 2005 linux.conf.au.
        51. January 2005 RCU Semantics: A First Attempt with Jon Walpole (bibtex). Technical report: engineering math meets RCU semantics.
        52. December 2004 James Morris‘s Recent Developments in SELinux Kernel Performance paper describes how RCU helped scalability of the SELinux audit vector cache (AVC). (I didn‘t have any involvement in creating this paper, but believe that it is well worth bringing to your attention.)
        53. June 2004 paper describing modifications to the Linux RCU implementation to make it safe for realtime use (bibtex).
        54. May 2004 dissertation and presentation from Ph.D. defense (bibtex). Also some advice for others who are embarking on a part-time Ph.D. program, and the announcement.
        55. January 2004 paper and presentation for RCU performance on different CPUs at linux.conf.au in Adelaide, Australia (bibtex).
        56. January 2004 Scaling dcache with RCU (bibtex).
        57. October 2003 Linux Journal introduction to RCU (bibtex).
        58. PDF revision of FREENIX‘03 paper (focusing on use of RCU in Linux‘s System-V IPC implementation) and corresponding presentation (bibtex).
        59. Enabling Autonomic Behavior in Systems Software With Hot Swapping (bibtex): describes how a RCU (AKA "generations") is used in K42 to enable hot-swapping of implementations of kernel algorithms.
        60. PDF revision of OLS‘02 paper (focusing on Linux-kernel infrastructure) and corresponding presentation (bibtex).
        61. PDF revision of OLS‘01 paper (oriented to Linux kernel) and corresponding presentation (bibtex).
        62. PDF revision of RPE paper (more theoretical).
        63. PDF revision of PDCS‘98 paper (DYNIX/ptx) (bibtex).
        64. Read-Copy Update: Using Execution History to Implement Low-Overhead Solutions to Concurrency Problems. Introduction to read-copy update.
        65. (slightly outdated) HTML version.

        Linux RCU Work

        The best summary of Linux RCU work is graphical, and may be found here.

        Some selected RCU patches:

        1. RCU was accepted into the Linux 2.5.43 kernel. Patches to RCU were applied to the 2.5.44 and 2.5.45 kernels. RCU was thus fully functional in 2.5.45 and later Linux kernels, just in time for the Halloween functionality freeze. ;-)
        2. Patch to the System V IPC implementation using RCU was accepted into the Linux 2.5.46 kernel.
        3. Patch providing a lock-free IPv4 route cache was accepted into the Linux 2.5.53 kernel.
        4. Patch providing lock-free handler traversal for IPMI handling, added to the Linux 2.5.58 kernel.
        5. Patch providing lock-free lookup of directory entries in the dcache subsystem, added to the Linux 2.5.62 kernel.
        6. Patches to replace many uses of brlock with RCU in the 2.5.69 kernel, with brlock being entirely eliminated in the 2.5.70 kernel.
        7. NMI handling for oprofile uses RCU in the 2.5.73 kernel.
        8. Fix ppc64 {pte,pmd}_free vs. hash_page race with RCU in the 2.6.2 kernel.
        9. Additional patches to the Linux kernel apply RCU to FD-set management, task-list traversal, and i_shared_sem contention reduction.
        10. Yet more patches change RCU‘s API to conserve memory and stack space.
        11. Another patch to monitor RCU grace period.
        12. Another patch to apply RCU to fasync_lock, perhaps for the 2.7 timeframe.
        13. Another set of patches apply modifications to the RCU infrastructure to make it safe for soft-realtime use (0/21/22/2).
        14. The Reiser4 filesystem uses RCU to defer freeing of jnodes.
        15. An auditing patch uses RCU to guard the lists of auditing rules.
        16. An SELinux scalability patch uses RCU to guard the audit vector cache, with 500x improvement in write() throughput on 32 CPUs, and about 50% improvement on 2 CPUs.

        K42 RCU Work

        1. K42 is a research OS at IBM that uses RCU pervasively as an existence lock. K42 developed RCU independently, as described in the Gamsa paper.
        2. K42 also uses RCU as a basis for hot-swapping: overview and infrastructure, and implementation details and results.
时间: 2024-10-16 22:13:35

linux 并发 RCU的相关文章

Linux并发与同步专题 (2)spinlock

关键词:wfe.FIFO ticket-based.spin_lock/spin_trylock/spin_unlock.spin_lock_irq/spin_lock_bh/spin_lock_irqsave. <Linux并发与同步专题 (1)原子操作和内存屏障> <Linux并发与同步专题 (2)spinlock> <Linux并发与同步专题 (3) 信号量> <Linux并发与同步专题 (4) Mutex互斥量> <Linux并发与同步专题 (

Linux并发与同步专题 (3) 信号量

关键词:. <Linux并发与同步专题 (1)原子操作和内存屏障> <Linux并发与同步专题 (2)spinlock> <Linux并发与同步专题 (3) 信号量> <Linux并发与同步专题 (4) Mutex互斥量> <Linux并发与同步专题 (5) 读写锁> <Linux并发与同步专题 (6) RCU> <Linux并发与同步专题 (7) 内存管理中的锁> <Linux并发与同步专题 (8) 最新更新与展望

Linux并发与同步专题

并发访问:多个内核路径同时访问和操作数据,就有可能发生相互覆盖共享数据的情况,造成被访问数据的不一致. 临界区:访问和操作共享数据的代码段. 并发源:访问临界区的执行线程或代码路径. 在内核中产生并发访问的主要有如下4种: 中断和异常:中断发生后,中断处理程序和被中断的进程之间有可能产生并发访问.中断<==>被中断的线程 软中断和tasklet:软中断或者tasklet随时可能会被调度执行,从而打断当前正在执行的进程上下文.软中断<==>进程上下文 内核抢占:调度器支持可抢占特性,

Linux内核RCU(Read Copy Update)锁简析

在非常早曾经,大概是2009年的时候.写过一篇关于Linux RCU锁的文章<RCU锁在linux内核的演变>,如今我承认.那个时候我尽管懂了RCU锁,可是我没有能力用一种非常easy的描写叙述把Linux的实现给展示出来,有道是你能给别人用你自己的方式非常简洁地描写叙述清楚,你才是真正的精通它.否则,无异于背诵.换个说法,假设你在被面试.在短时间内靠嘴说给面试官,且他还要能听明白,就说明自己真的懂了,这样的时候,是不会给你机会分析源码的,也不可能让你背诵源码.       时隔五年多,最近又

linux并发服务器设计

linux 并发服务器: http://blog.csdn.net/ygl840455828ygl/article/details/52438167 http://www.2cto.com/os/201309/245280.html http://www.cnblogs.com/venow/archive/2012/11/22/2779667.html http://blog.csdn.net/turkeyzhou/article/details/8609360 1 背景简介 H330S模块集成

linux 内核 RCU机制详解

RCU(Read-Copy Update)是数据同步的一种方式,在当前的Linux内核中发挥着重要的作用.RCU主要针对的数据对象是链表,目的是提高遍历读取数据的效率,为了达到目的使用RCU机制读取数据的时候不对链表进行耗时的加锁操作.这样在同一时间可以有多个线程同时读取该链表,并且允许一个线程对链表进行修改(修改的时候,需要加锁).RCU适用于需要频繁的读取数据,而相应修改数据并不多的情景,例如在文件系统中,经常需要查找定位目录,而对目录的修改相对来说并不多,这就是RCU发挥作用的最佳场景.

Linux内核RCU(Read Copy Update)锁简析-前传

如果你用Linux perf tool的top命令做热点纠察时,你会发现,前10名嫌疑犯里面肯定有好几个都是锁!在进行并行多处理时,不可避免地会遇到锁的问题,这是不可避免的,因为这一直以来也许是保护共享数据的唯一方式,被保护的区域就是临界区.而我们知道,锁的开销是巨大的,因为它不可避免地要么等待,要么让别人等待,然而这并不是开销的本质,开销的本质在于很多锁都采用了"原子操作"这么一个技术,如此一个原子操作会对总线或者cache一致性造成很大的影响,比如要对一个变量进行原子加1,不要认为

Linux 并发服务器雏形总结

如下介绍一个并发回射客户端/服务器的雏形,所谓回射:就是客户端输入一条数据,服务器端读取并显示,然后服务器端再把刚读取的信息发送回客户端进行显示.示意图如下: 所谓并发服务器:就是一个服务器可以同时为多个连入的客户端提供服务,示意图如下: 如下主要介绍两种实现并发回射服务器的方式,一种是通过子进程方式实现并发,一种是通过I/O多路转接实现并发. 并发服务器(1)[子进程方式] 1 [[email protected] tcp]# cat echoserv_childprocess.c 2 #in

linux网络编程-----&gt;高并发---&gt;epoll多路I/O转接服务器

做网络服务的时候并发服务端程序的编写必不可少.前端客户端应用程序是否稳定一部分取决于客户端自身,而更多的取决于服务器是否相应时间够迅速,够稳定. 常见的linux并发服务器模型: 多进程并发服务器 多线程并发服务器 select多路I/O转接服务器 poll多路I/O转接服务器 epool多路I/O转接服务器. 本次主要讨论poll多路I/转接并发服务器模型: 前几章介绍完了多进程并发服务器,  多线程并发服务器, selete多路I/O转接服务器,  poll多路I/O转接服务器, 本章开始介