Boosting user thread priorities to resolve priority inversions
First Claim
1. A method implemented in a computing device, the method comprising:
- in response to determining to switch contexts in the computing device, retrieving lock data from a lock buffer of a user-mode thread being switched out, the lock data including an identifier identifying one or more resources that the user-mode thread has locked;
adding the retrieved lock data to a lock record that is associated with a process that includes the user-mode thread;
determining, based on the lock record and the lock data, whether the user-mode thread is in a priority inversion; and
increasing a priority of the user-mode thread in response to determining that the user-mode thread is in a priority inversion.
1 Assignment
0 Petitions
Accused Products
Abstract
The threads of a user mode process can access various different resources of a computing device, and such access can be serialized. To access a serialized resource, a thread acquires a lock for the resource. For each context switch in the computing device, a module of the operating system kernel checks for priority inversions, which is a situation in which a higher priority thread of the user mode process is waiting for (blocking on) a resource for which a lower priority thread has acquired a lock. In response to detecting such a priority inversion, the priority of the lower priority thread is boosted to allow the priority thread to execute and eventually release the lock that the higher priority thread is waiting for.
12 Citations
20 Claims
-
1. A method implemented in a computing device, the method comprising:
-
in response to determining to switch contexts in the computing device, retrieving lock data from a lock buffer of a user-mode thread being switched out, the lock data including an identifier identifying one or more resources that the user-mode thread has locked; adding the retrieved lock data to a lock record that is associated with a process that includes the user-mode thread; determining, based on the lock record and the lock data, whether the user-mode thread is in a priority inversion; and increasing a priority of the user-mode thread in response to determining that the user-mode thread is in a priority inversion. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A computing device comprising:
-
one or more processors; and a computer-readable storage media having stored thereon multiple instructions that, when executed by the one or more processors, cause the one or more processors to; retrieve, in response to a context switch in the computing device, lock data from a lock buffer of a user-mode thread being switched out, the lock data including an identifier of one or more resources that the user-mode thread has locked; add the lock data, including the identifier, to a lock record that is associated with a process that includes the user-mode thread; determine, based on the identifier in the lock record, whether there is a priority inversion involving the user-mode thread; and based on the determining step determining that there is a priority inversion involving the user-mode thread, increasing a priority of the user-mode thread. - View Dependent Claims (13, 14, 15, 16)
-
-
17. Computer-readable storage hardware storing instructions configured to cause a computing device to perform a process, the process comprising:
-
maintaining thread-lock buffers for respective threads of a process, the threads having respective priorities, the maintaining comprising, for each thread; when requesting a lock on a resource, adding an identifier of the resource to its respective thread-lock buffer; and when releasing a lock on a resource, removing an identifier of the resource from its respective thread-lock buffer; each time one of the threads is context-switched out of the processor; maintaining a lock-tracking record corresponding to the thread being context-switched out by (i) determining that the lock-tracking record lacks an entry for a resource that is in the corresponding thread-lock, and (ii) based thereon, adding an identifier of the resource to the lock-tracking record; and determining whether any of the threads are in a priority inversion based on the identifiers of resources in the lock-tracking record, and when a thread is determined to be in a priority inversion, increasing the priority of the determined thread. - View Dependent Claims (18, 19, 20)
-
Specification