Method of using collaborative spinlocks to provide exclusive access to a resource in a multiprocessor computer system
First Claim
1. In a multiprocessor computing system having memory shared by all processors of the computing system and including an operating system, a method for protecting the execution state of an operating system kernel extension written to run in a uniprocessor environment using a interrupt time spinlock and a task time spinlock, comprising the steps of:
- at task time, prior to calling the kernel extension, having the operating system acquire the task time spinlock and then wait to call the kernel extension until the interrupt time spinlock is unowned; and
at interrupt time, prior to calling the kernel extension, having the operating system acquire the interrupt time spinlock and wait to call the kernel extension until the task time spinlock is unowned or, if the task time spinlock is owned, a processor owning the task time spinlock is placed in a predetermined condition.
1 Assignment
0 Petitions
Accused Products
Abstract
A multiprocessor computing system has memory shared by all processors of the computing system and includes an symmetric multiprocessor (SMP) operating system and at least one external device controlled by a device driver. The device driver is typically written to run in a uniprocessor environment. A method for protecting the execution state of the device driver uses a pair of "collaborative" spinlocks, an interrupt time spinlock and a task time spinlock. At task time, prior to calling the device driver, the task time spin lock is acquired by the operating system. The operating system then waits until the interrupt time spinlock is in an "unowned" state before calling the device driver. Upon return from the device driver, the operating system releases the task time spinlock. At interrupt time, prior to calling the device driver'"'"'s interrupt handler, the interrupt time spinlock is acquired by the operating system. The operating system then determines if the task time spinlock is owned. If it is owned, the operating system then issues an interprocessor interrupt (IPI) to the processor owning the task time spinlock, thus placing that processor into a predetermined "spin" state. The receiving processor remains in the spinning state until return of the device driver execution.
60 Citations
29 Claims
-
1. In a multiprocessor computing system having memory shared by all processors of the computing system and including an operating system, a method for protecting the execution state of an operating system kernel extension written to run in a uniprocessor environment using a interrupt time spinlock and a task time spinlock, comprising the steps of:
-
at task time, prior to calling the kernel extension, having the operating system acquire the task time spinlock and then wait to call the kernel extension until the interrupt time spinlock is unowned; and at interrupt time, prior to calling the kernel extension, having the operating system acquire the interrupt time spinlock and wait to call the kernel extension until the task time spinlock is unowned or, if the task time spinlock is owned, a processor owning the task time spinlock is placed in a predetermined condition. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. In a multiprocessor computing system having memory shared by all processors of the computing system and including a symmetric multiprocessor (SMP) operating system, a method for protecting the execution state of a device driver written to run in a uniprocessor environment using a interrupt time spinlock and a task time spinlock, comprising the steps of:
-
at task time, determining whether the task time spinlock can be acquired by the operating system; if, at task time, the task time spinlock can be acquired by the operating system, having the operating system acquire the task time spinlock and then wait to call the device driver until the interrupt time spinlock is unowned; at interrupt time, determining whether the interrupt time spinlock can be acquired by the operating system; and if, at interrupt time, the interrupt time spinlock can be acquired by the operating system, having the operating system acquire the interrupt time spinlock and then wait to call the device driver until the task time spinlock is unowned or, if the task time spinlock is owned, the processor owning the task time spinlock is placed in a predetermined condition. - View Dependent Claims (9, 10, 11, 12)
-
-
13. In a multiprocessor computing system having memory shared by all processors of the computing system and including a symmetric multiprocessor (SMP) operating system, a method operative at task time for protecting the execution state of a device driver written to run in a uniprocessor environment using a interrupt time spinlock and a task time spinlock, comprising the steps of:
-
determining whether the task time spinlock can be acquired by the operating system; if the task time spinlock cannot be acquired by the operating system, placing the task time spinlock in a spin on read condition; if the task time spinlock can be acquired by the operating system, having the operating system acquire the task time spinlock; determining whether the interrupt time spinlock is owned by another processor; if the interrupt time spinlock is unowned, having the operating system call the device driver. - View Dependent Claims (14, 15)
-
-
16. In a multiprocessor computing system having memory shared by all processors of the computing system and including a symmetric multiprocessor (SMP) operating system, a method operative at interrupt time for protecting the execution state of a device driver written to run in a uniprocessor environment using a interrupt time spinlock and a task time spinlock, comprising the steps of:
-
determining whether the interrupt time spinlock can be acquired by the operating system; if the interrupt time spinlock cannot be acquired by the operating system, placing the interrupt time spinlock in a spin on read condition; if the interrupt time spinlock can be acquired by the operating system, determining whether the task time spinlock is owned by a given processor; if the task time spinlock is owned by the given processor, placing the given processor in a predetermined condition; and having the operating system call the device driver. - View Dependent Claims (17, 18, 19, 20)
-
-
21. A computer program product in a computer-readable medium for use in a multiprocessor computing system having memory shared by all processors of the computing system and including an operating system, the computer program product for protecting the execution state of a device driver written to run in a uniprocessor environment, comprising:
-
an interrupt time spinlock; a task time spinlock; first code means, operative at task time and prior to calling the kernel extension, for controlling the operating system to acquire the task time spinlock and then to wait to call the kernel extension until the interrupt time spinlock is unowned; and second code means, operative at interrupt time and prior to calling the kernel extension, for controlling the operating system to acquire the interrupt time spinlock and then to wait to call the kernel extension until either the task time spinlock is unowned or, if the task time spinlock is owned, a processor owning the task time spinlock is placed in a predetermined condition. - View Dependent Claims (22, 23)
-
-
24. A computer system, comprising:
-
a plurality of processors; a symmetric multiprocessing (SMP) operating system; at least one external device; a device driver for controlling the at least one external device; and means for preventing concurrent access to the device driver by the plurality of processors, the preventing means comprising; an interrupt time spinlock; a task time spinlock; first code means, operative at task time and prior to calling the kernel extension, for controlling the operating system to acquire the task time spinlock and then to wait to call the kernel extension until the interrupt time spinlock is unowned; and second code means, operative at interrupt time and prior to calling the kernel extension, for controlling the operating system to acquire the interrupt time spinlock and then to wait to call the kernel extension until either the task time spinlock is unowned or, if the task time spinlock is owned, a processor owning the task time spinlock is placed in a predetermined condition. - View Dependent Claims (25, 26)
-
-
27. In a computing system wherein multiple processors contend for a resource, the computing system including an operating system, a method for protecting the execution state of the resource using a first spinlock and a second spinlock, comprising the steps of:
-
at a first time, and prior to calling the resource, having the operating system acquire the second spinlock and then wait to call the resource until the first spinlock is unowned; and at a second time, and prior to calling the resource, having the operating system acquire the first spinlock and wait to call the resource until the second spinlock is unowned or, if the second spinlock is owned, a processor owning the second spinlock is placed in a predetermined condition. - View Dependent Claims (28)
-
-
29. A computer program product in a computer-readable medium for use in a multiprocessor computing system having an operating system and at least one resource, the computer program product for protecting the execution state of the resource, comprising:
-
a first spinlock; a second spinlock; first code means, operative at a task time and prior to calling the resource, for controlling the operating system to acquire the second spinlock and then to wait to call the resource until the first spinlock is unowned; and second code means, operative at an interrupt time and prior to calling the resource, for controlling the operating system to acquire the first spinlock and then to wait to call the resource until either the second spinlock is unowned or, if the second spinlock is owned, a processor owning the second spinlock is placed in a predetermined condition.
-
Specification