IP Library › Granted Patent US 12,322,414
Granted Patent B2
US 12,322,414 · App. 17/337,891 · Granted Jun 3, 2025

Global secondary path locking technique enabling high read concurrency for read-mostly workloads

Inventors: Alex Kogan (Needham, MA); David Dice (Foxboro, MA)
Assignee: Oracle International Corporation
G11B20/10268G06F9/526G06F16/2343G06F16/2365G11B20/105G11C16/26
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,322,414
App. No.
17/337,891
Granted
Jun 3, 2025
Kind
B2
Abstract

A reader of a set of data accessors that includes readers and writer detects that a particular lock of a first collection of non-global locks associated with a data object of a computing environment is held by another accessor. After checking a blocking indicator, the reader uses a second lock (which is not part of the first collection) to obtain read access to the data object and implements its reads without acquiring the particular lock. Prior to implementing a write on the data object, a writer acquires at least some locks of the first collection, and sets the blocking indicator to prevent readers from using the second lock to obtain read access to the data object.

Claims (56)

1. A computer-implemented method, comprising:

determining, by a first reader of a plurality of data accessors, whether a particular lock of a first collection of one or more locks associated with a first data object is held by another data accessor;

based at least in part on determining that the particular lock is held by the other data accessor:

utilizing, by the first reader, after checking a blocking indicator different from the particular lock to determine that read access is permitted for the first data object, a second lock associated with the first data object to obtain read access to the first data object, wherein the second lock is not a member of the first collection, and wherein the blocking indicator indicates whether the first reader is prevented from utilizing the second lock to obtain read access to the first data object; and

implementing, by the first reader, one or more read operations on the first data object, without acquiring the particular lock; and

based at least in part on determining that the particular lock is not held by the other data accessor, implementing the one or more read operations on the first data object subsequent to acquiring the particular lock.

2. The computer-implemented method as recited in claim 1 , wherein the other accessor holding the particular lock is a second reader of the plurality of data accessors.

3. The computer-implemented method as recited in claim 1 , wherein the plurality of data accessors comprises a second reader, the computer-implemented method further comprising:

in response to detecting, by the second reader that another lock of the first collection of one or more locks is held by another data accessor,

utilizing, by the second reader, after checking the blocking indicator and prior to the completion of the one or more read operations of the first reader, the second lock associated with the first data object to obtain read access to the first data object; and

implementing, by the second reader, one or more read operations on the first data object, without acquiring the other lock of the first collection.

4. The computer-implemented method as recited in claim 1 , wherein utilizing the second lock comprises modifying a counter associated with the second lock.

5. The computer-implemented method as recited in claim 1 , wherein the plurality of data accessors includes a first writer, the computer-implemented method further comprising:

prior to implementing a write operation on the first data object by the first writer,

acquiring, by the first writer, one or more locks of the first collection of locks, and

setting, by the first writer, the blocking indicator to prevent another reader from using the second lock to obtain read access to the first data object.

6. The computer-implemented method as recited in claim 1 , wherein the plurality of data accessors run in a computing environment comprising a particular count of processing elements, and wherein the number of locks included in the first collection of locks is based at least in part on the particular count.

7. The computer-implemented method as recited in claim 6 , wherein an individual processing element of the computing environment comprises one of: (a) a CPU (central processing unit), (b) a core, or (c) a NUMA (non-uniform memory access) node.

8. A system, comprising:

one or more computing devices;

wherein the one or more computing devices include instructions that upon execution on or across one or more processors cause a first reader of a plurality of data accessors to:

determine whether a particular lock of a first collection of one or more locks associated with a first data object is held by another data accessor; based at least in part on determining that the particular lock is held by the other data accessor:

utilize, after checking a blocking indicator different from the particular lock to determine that read access is permitted for the first data object, a second lock associated with the first data object to obtain read access to the first data object, wherein the second lock is not a member of the first collection, and wherein the blocking indicator indicates whether the first reader is prevented from utilizing the second lock to obtain read access to the first data object; and

implement one or more read operations on the first data object, without acquiring the particular lock; and

based at least in part on determining that the particular lock is not held by the other data accessor, implement the one or more read operations on the first data object subsequent to acquiring the particular lock.

9. The system as recited in claim 8 , wherein the other accessor holding the particular lock is a second reader of the plurality of data accessors.

10. The system as recited in claim 8 , wherein the plurality of data accessors comprises a second reader, and wherein the one or more computing devices include further instructions that upon execution on or across one or more processors further cause the second reader to:

in response to detecting that another lock of the first collection of one or more locks is held by another data accessor,

utilize, after checking the blocking indicator and prior to the completion of the one or more read operations of the first reader, the second lock associated with the first data object to obtain read access to the first data object; and

implement one or more read operations on the first data object, without acquiring the other lock of the first collection.

11. The system as recited in claim 8 , wherein to cause the first reader to utilize the second lock, the one or more computing devices include further instructions that upon execution on or across one or more processors further cause the first reader to:

modify a counter associated with the second lock.

12. The system as recited in claim 8 , wherein the plurality of data accessors includes a first writer, and wherein the one or more computing devices include further instructions that upon execution on or across one or more processors further cause the first writer to:

prior to implementing a write operation on the first data object,

acquire one or more locks of the first collection of locks, and

set the blocking indicator to prevent another reader from using the second lock to obtain read access to the first data object.

13. The system as recited in claim 8 , wherein the plurality of data accessors run in a computing environment comprising a particular count of processing elements, and wherein the number of locks included in the first collection of locks is based at least in part on the particular count.

14. The system as recited in claim 13 , wherein an individual processing element of the computing environment comprises one of: (a) a CPU (central processing unit), (b) a core, or (c) a NUMA (non-uniform memory access) node.

15. One or more non-transitory computer-accessible storage media storing program instructions that when executed on or across one or more processors:

cause a first reader of a plurality of data accessors to:

determine whether a particular lock of a first collection of one or more locks associated with a first data object is held by another data accessor; based at least in part on determining that the particular lock is held by the other data accessor:

utilize, after checking a blocking indicator different from the particular lock to determine that read access is permitted for the first data object, a second lock associated with the first data object to obtain read access to the first data object, wherein the second lock is not a member of the first collection, and wherein the blocking indicator indicates whether the first reader is prevented from utilizing the second lock to obtain read access to the first data object; and

implement one or more read operations on the first data object, without acquiring the particular lock; and

based at least in part on determining that the particular lock is not held by the other data accessor, implement the one or more read operations on the first data object subsequent to acquiring the particular lock.

16. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the other accessor holding the particular lock is a second reader of the plurality of data accessors.

17. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the plurality of data accessors comprises a second reader, and wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across one or more processors further cause the second reader to:

in response to detecting that another lock of the first collection of one or more locks is held by another data accessor,

utilize, after checking the blocking indicator and prior to the completion of the one or more read operations of the first reader, the second lock associated with the first data object to obtain read access to the first data object; and

implement one or more read operations on the first data object, without acquiring the other lock of the first collection.

18. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein to cause the first reader to utilize the second lock, the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across one or more processors further cause the first reader to:

modify a counter associated with the second lock.

19. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the plurality of data accessors includes a first writer, and wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across one or more processors further cause the first writer to:

prior to implementing a write operation on the first data object,

acquire one or more locks of the first collection of locks, and

set the blocking indicator to prevent another reader from using the second lock to obtain read access to the first data object.

20. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the plurality of data accessors run in a computing environment comprising a particular count of processing elements, and wherein the number of locks included in the first collection of locks is based at least in part on the particular count.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 4, 2021
From: KOGAN, ALEX; DICE, DAVID
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 056439/0478 →
Continuity (3)
Continuation 16203511 · Nov 28, 2018
Provisional Application 62734197 · Sep 20, 2018
Related Publication 20210287716A1 · Sep 16, 2021
References Cited (60)
US 6912663B1 · Dayan · 2005 [cited by examiner]
US 7934062B2 · McKenney · 2011 [cited by applicant]
US 8332374B2 · Lev · 2012 [cited by applicant]
US 8504540B2 · Olszewski et al. · 2013 [cited by applicant]
US 8799591B2 · Larson · 2014 [cited by examiner]
US 9329895B2 · Steinmacher-Burrow · 2016 [cited by applicant]
US 9824018B2 · Joshi · 2017 [cited by applicant]
US 9910893B2 · Li · 2018 [cited by applicant]
US 10346220B2 · Liu · 2019 [cited by examiner]
US 10535368B1 · Dice et al. · 2020 [cited by applicant]
US 10811049B2 · Dice et al. · 2020 [cited by applicant]
US 11056145B2 · Kogan · 2021 [cited by examiner]
US 11170816B2 · Dice et al. · 2021 [cited by applicant]
US 11594252B2 · Dice et al. · 2023 [cited by applicant]
US 11972777B2 · Dice et al. · 2024 [cited by applicant]
US 20070165319A1 · Fisher · 2007 [cited by applicant]
US 20130151466A1 · Skaria et al. · 2013 [cited by applicant]
US 20130290967A1 · Calciu · 2013 [cited by examiner]
US 20150286586A1 · Yadav · 2015 [cited by examiner]
US 20170017532A1 · Falco · 2017 [cited by examiner]
US 20170308565A1 · Broll et al. · 2017 [cited by applicant]
US 20240265945A1 · Dice et al. · 2024 [cited by applicant]
U.S. Appl. No. 16/290,431, filed Mar. 1, 2019, David Dice. [cited by applicant]
Bjorn B. Brandenburg, et al., “Spin-Based Reader-Writer Synchronization for Multiprocessor Real-Time Systems”, in Real-Time Systems Journal, Sep. 2010, pp. 1-61. [cited by applicant]
Irina Calciu, et al., “NUMA-Aware Reader-Writer Locks”, ACM, PPoPP'13, Feb. 23-27, 2013, pp. 157-166. [cited by applicant]
Jonathan Corbert, “Big reader locks”, Retrieved from https://lwn.net/Articles/378911, Mar. 16, 2010, pp. 1-2. [cited by applicant]
Luke Dalessandro, et al., “Hybrid NOrec: A Case Study in the Effectiveness of Best Effort Hardware Transactional Memory”, ACM, ASPLOS'11, Mar. 5-11, 2011, pp. 39-51. [cited by applicant]
Peter Damron, et al., “Hybrid Transactional Memory”, in Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2006, pp. 336-346. [cited by applicant]
Dave Dice, et al., “Refined Transactional Lock Elision”, in Proceedings of the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPOPP), 2016, pp. 1-12. [cited by applicant]
Alex Kogan, et al., “A Methodology for Creating Fast Wait-Free Data Structures”, in Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Feb. 2012, pp. 141. [cited by applicant]
Yossi Lev, et al., “Scalable Reader-Writer Locks”, ACM, SPAA'09, Aug. 11-13, 2009, pp. 1-10. [cited by applicant]
Ran Liu, et al, “Scalable Read-mostly Synchronization Using Passive Reader-Writer Locks”, in Proceedings of the USENIX Annual Technical Conference (ATC), 2014, pp. 219-230. [cited by applicant]
Nick Piggin, “kernel: introduce brlock”, Retrieved from https://lwn.net/Articles/378781, Mar. 16, 2010, pp. 1-3. [cited by applicant]
“Distributed Cache-Line Counter Scalable RW-Lock”, Retrieved from http://concurrencyfreaks.blogspot.com/2013/09/distributed-cache-line-counter-scalable.html, Sep. 1, 2013, pp. 1-6. [cited by applicant]
Yehuda Afek, et al., “Cache Index-Aware Memory Allocation”, ACM, ISMM'11, Jun. 2011, pp. 1-10. [cited by applicant]
Jonathan Corbert, “Driver porting: mutual exclusion with seqlocks”, Retrieved from https://lwn.net/Articles/378911, 2010, pp. 1-2. [cited by applicant]
Mathieu Desnoyers, et al., “User-Level Implementations of Read-Copy Update”, IEEE Transactions on Parallel and Distributed Systems, 2009, pp. 1-14. [cited by applicant]
Dave Dice et al, “Lightweight Contention Management for Efficient Compare-and-Swap Operations”, dated May 24, 2013, pp. 1-25. [cited by applicant]
Dave Dice et al, “Scalable Statistics Counters”, Dated Jun. 23-25, 2013, pp. 1-10. [cited by applicant]
Dave Dice et al, “Early Experience with a commercial Hardware Transactional Memory Implementation”, dated Oct. 2009, pp. 1-60. [cited by applicant]
David Dice, et al., “Lock Cohorting: A General Technique for Designing NUMA Locks”, ACM, Transactions on Parallel Computing, vol. 1, No. 2, Article 13, Jan. 2015, pp. 13:1-13:42. [cited by applicant]
David Dice, “Quickly reacquirable locks”, Retrieved from https://patents.google.com/patent/US7814488, 2002, pp. 1. [cited by applicant]
Pascal Felber, et al., “Hardware Read-Write Lock Elision”, EuroSys'16, Apr. 2016, pp. 1-15. [cited by applicant]
Wilson C. Hsieh, et al., “Scalable Reader-Writer Locks for Parallel Systems”, in Proceedings Sixth International Parallel Processing Symposium, 1992, pp. 1-19. [cited by applicant]
Andi Kleen, “Lock elision in the GNU C library”, Retrieved from https://lwn.net/Articles/534758, Jan. 30, 2013, pp. 1-7. [cited by applicant]
Christoph Lameter, “Effective Synchronization on Linux/NUMA Systems”, Gelato Conference 2005, pp. 1-23. [cited by applicant]
George Marsaglia, “Xorshift RNGs”, Journal of Statistical Software Articles, 2003, Retrieved from https://doi.org/10.18637/jss.v008.i14, pp. 1-6. [cited by applicant]
John M. Mello-Crummey, et al., “Scalable Reader-Writer Synchronization for Shared-Memory Multiprocessors”, in Proceedings of the Third ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPOPP 91),… [cited by applicant]
Oracle, “Class StampedLock”, Retrieved from https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html, 2012, pp. 1-13. [cited by applicant]
Filip Pizlo, et al., “Fine-grained Adaptive Biased Locking”, ACM, PPPJ'11, Aug. 2011, pp. 1-11. [cited by applicant]
Ravi Rajwar, et al., “Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution”, in Proceedings of the 34th Annual ACM/IEEE International Symposium on Microarchitecture (MICRO 34), IEEE Computer Soci… [cited by applicant]
“A persistent key-value store for fast storage environments”, Retrieved from www.rocksdb.org, 2018, pp. 1. [cited by applicant]
Kenneth Russell, et al., “Eliminating Synchronization-Related Atomic Operations with Biased Locking and Bulk Rebiasing”, ACM, OOPSLA'06, Copyright Sun Microsystems, Inc., Oct. 2006, pp. 1-9. [cited by applicant]
Jun Shirako, et al, “Design, Verification and Applications of a New Read-Write Lock Algorithm”, ACM, SPAA'12, Jun. 25-27, 2012, pp. 1-10. [cited by applicant]
Nalini Vasedevan, et al., “Simple and Fast Biased Locks”, ACM, PACT'10, Sep. 11-15, 2010, pp. 1-9. [cited by applicant]
D. Vyukov, “Distributed Reader-Writer Mutex”, Retrieved from http://www.1024cores.ent/home/lock-free-algorithms/reader-writer-mutex, 2011, pp. 1-7. [cited by applicant]
Wikipedia, “Loss aversion”, Retrieved from https://en.wikipeida.org/wiki/Loss_aversion on Jul. 25, 2019, pp. 1-12. [cited by applicant]
Wikipedia, “Ski rental problem”, Retrieved from https://en.wikipedia.org/w/index.php?title=Ski_rental_problem&oldid=. . . on Jul. 25, 2019, pp. 1-4. [cited by applicant]
Wikipedia, “Birthday problem”, Retrieved from https://en.wikipedia.org/w/index.php?title=Birthday_problem&oldid=85 . . . on Jul. 25, 2019, pp. 1-10. [cited by applicant]
David Dice, “Biased Locking in HotSpot”, Aug. 18, 2006, Retrieved from https://blogs.oracle.com/dave/biased-locking-in-hotspot, pp. 1-8. [cited by applicant]