System and method for supporting an adaptive self-tuning locking mechanism in a transactional middleware machine environment
First Claim
1. A method for supporting an adaptive locking mechanism in a transactional middleware machine environment, the method comprising:
- monitoring performing, via each process of a plurality of processes during a first tuning period and using a first spin count, test-and-set (TAS) operations in order to obtain locks for data in a shared memory, wherein the first spin count specifies a first maximum number of rounds of the TAS operations that are allowed by each process of the plurality of processes during the first tuning period;
storing the first spin count as a last good spin count;
obtaining a first spin failure rate for the first tuning period, wherein a first spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the first maximum number of rounds of the TAS operations that are allowed to the process during the first tuning period;
adaptively configuring a second spin count for a second tuning period after the first tuning period based on the obtained first spin failure rate, wherein the second spin count is different than the last good spin count and specifies a second maximum number of rounds of the TAS operations that are allowed by each process of the plurality of processes during the second tuning period;
monitoring performing, via each process of the plurality of processes during the second tuning period and using the second spin count, the TAS operations in order to obtain locks for the data in the shared memory;
obtaining a second spin failure rate for the second tuning period, wherein a second spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the second maximum number of rounds of the TAS operations that are allowed to the process during the second tuning period;
selectively configuring a next spin count for a next tuning period after the second tuning period to be the second spin count and storing the second spin count as the last good spin count responsive to the second spin failure rate being less than the first spin failure rate; and
selectively configuring the next spin count for the next tuning period after the second tuning period to be the last good spin count responsive to the second spin failure rate being greater than the first spin failure rate.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method can support an adaptive self-tuning locking mechanism in a transactional middleware machine environment. The system allows each process in a plurality of processes to perform one or more test-and-set (TAS) operations in order to obtain a lock for data in a shared memory. Then, the system can obtain a spin failed rate for a current tuning period, wherein a spin failure happens when a process fails to obtain the lock after performing a maximum number of rounds of TAS operations that are allowed. Furthermore, the system can adaptively configuring a spin count for a next tuning period based on the obtained spin failure rate, wherein the spin count specifies the maximum number of rounds of TAS operations that are allowed for the next tuning period.
20 Citations
20 Claims
-
1. A method for supporting an adaptive locking mechanism in a transactional middleware machine environment, the method comprising:
-
monitoring performing, via each process of a plurality of processes during a first tuning period and using a first spin count, test-and-set (TAS) operations in order to obtain locks for data in a shared memory, wherein the first spin count specifies a first maximum number of rounds of the TAS operations that are allowed by each process of the plurality of processes during the first tuning period; storing the first spin count as a last good spin count; obtaining a first spin failure rate for the first tuning period, wherein a first spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the first maximum number of rounds of the TAS operations that are allowed to the process during the first tuning period; adaptively configuring a second spin count for a second tuning period after the first tuning period based on the obtained first spin failure rate, wherein the second spin count is different than the last good spin count and specifies a second maximum number of rounds of the TAS operations that are allowed by each process of the plurality of processes during the second tuning period; monitoring performing, via each process of the plurality of processes during the second tuning period and using the second spin count, the TAS operations in order to obtain locks for the data in the shared memory; obtaining a second spin failure rate for the second tuning period, wherein a second spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the second maximum number of rounds of the TAS operations that are allowed to the process during the second tuning period; selectively configuring a next spin count for a next tuning period after the second tuning period to be the second spin count and storing the second spin count as the last good spin count responsive to the second spin failure rate being less than the first spin failure rate; and selectively configuring the next spin count for the next tuning period after the second tuning period to be the last good spin count responsive to the second spin failure rate being greater than the first spin failure rate. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A system for providing an adaptive locking mechanism in a transactional middleware machine environment, comprising:
-
one or more processors; a plurality of processes, wherein each process in the plurality of processes operates to perform test-and-set (TAS) operations during a first tuning period and using a first spin count specifying a first maximum number of rounds of the TAS operations that are allowed during the first tuning period in order to obtain locks for data in a shared memory, wherein each process in the plurality of processes operates to perform the one or more test-and-set (TAS) operations in order to obtain locks for the data in the shared memory during a second tuning period after the first tuning period and using a second spin count specifying a second maximum number of rounds of the TAS operations that are allowed during the second tuning period; a transactional server, running on the one or more processors, the transactional server being operate to; store the first spin count as a last good spin count; obtain a first spin failure rate for the first tuning period, wherein a first spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the first maximum number of rounds of the TAS operations that are allowed to the process during the first tuning period; adaptively configure the second spin count for the second tuning period after the first tuning period based on the obtained first spin failure rate wherein the second spin count is different than the last good spin count; obtain a second spin failure rate for the second tuning period, wherein a second spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the second maximum number of rounds of the TAS operations that are allowed to the process during the second tuning period; selectively configure a next spin count for a next tuning period after the second tuning period to be the second spin count and storing the second spin count as the last good spin count responsive to the second spin failure rate being less than the first spin failure rate; selectively configure the spin count for the next tuning period after the second tuning period to be the last good spin count responsive to the second spin failure rate being greater than the first spin failure rate. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A non-transitory machine readable storage medium having instructions stored thereon that when executed cause a system to perform steps comprising:
-
monitoring performing, via each process of a plurality of processes during a first tuning period and using a first spin count, test-and-set (TAS) operations in order to obtain locks for data in a shared memory, wherein the first spin count specifies a first maximum number of rounds of the TAS operations that are allowed to each process of the plurality of processes during the first tuning period; storing the first spin count as a last good spin count; obtaining a first spin failure rate for the first tuning period, wherein a first spin failure comprises a process of the plurality of processes failing to obtain the a lock after performing the first maximum number of rounds of the TAS operations that are allowed to the process during the first tuning period; adaptively configuring a second spin count for a second tuning period after the first tuning period based on the obtained first spin failure rate, wherein the second spin count is different than the last good spin count and specifies a second maximum number of rounds of the TAS operations that are allowed to each process of the plurality of processes during the second tuning period; monitoring performing, via each process of the plurality of processes during the second tuning period and using the second spin count, the TAS operations in order to obtain locks for the data in the shared memory; obtaining a second spin failure rate for the second tuning period, wherein a second spin failure comprises a process of the plurality of processes failing to obtain a lock after performing the second maximum number of rounds of the TAS operations that are allowed to the process during the second tuning period; selectively configuring a next spin count for a next tuning period after the second tuning period to be the second spin count and storing the second spin count as the last good spin count responsive to the second spin failure rate being less than the first spin failure rate; selectively configuring the next spin count for the next tuning period after the second tuning period to be the last good spin count responsive to the second spin failure rate being greater than the first spin failure rate.
-
Specification