IP Library Granted Patent US 11,449,339
Granted Patent B2
US 11,449,339 · App. 16/586,099 · Granted Sep 20, 2022

Memory barrier elision for multi-threaded workloads

Inventors: Michael Tsirkin (Westford, MA); Andrea Arcangeli (New York, NY)
Assignee: Red Hat, Inc.
G06F9/3009G06F9/485G06F9/5027G06F9/522
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 11,449,339
App. No.
16/586,099
Granted
Sep 20, 2022
Kind
B2
Abstract

A system includes a memory, at least one physical processor in communication with the memory, and a plurality of hardware threads executing on the at least one physical processor. A first thread of the plurality of hardware threads is configured to execute a plurality of instructions that includes a restartable sequence. Responsive to a different second thread in communication with the first thread being pre-empted while the first thread is executing the restartable sequence, the first thread is configured to restart the restartable sequence prior to reaching a memory barrier.

Claims (36)

1. A system comprising:

a memory;

at least one physical processor in communication with the memory; and

a plurality of hardware threads executing on the at least one physical processor configured to:

execute, by a first hardware thread, one or more first instructions at a first time instant that modifies a value of a data structure;

execute, by the first hardware thread, a plurality of second instructions at a second time instant that occurs after the first time instant, wherein the plurality of second instructions is different than the one or more first instructions, and wherein the plurality of second instructions is tagged as atomic;

receive, by a second hardware thread, an interrupt at a third time instant that occurs after the second time instant, wherein the second hardware thread is different than the first hardware thread, and wherein the first hardware thread communicates with the second hardware thread;

responsive to the second hardware thread receiving the interrupt:

pause, by the first hardware thread, execution of the plurality of second instructions at the third time instant; and

restart, by the first hardware thread and at a fourth time instant that occurs after the third time instant, execution of the plurality of second instructions from the point at which the plurality of second instructions was executing at the second time instant prior to the first hardware thread reaching a write memory barrier; and

execute, after the fourth time instant and by the first hardware thread, a read instruction after the write memory barrier.

2. The system of claim 1 , wherein the first hardware thread and the different second hardware thread execute on the same physical processor.

3. The system of claim 1 , wherein the first hardware thread and the different second hardware thread execute on different physical processors.

4. The system of claim 1 , wherein the first hardware thread is configured to resume operation on a different physical processor.

5. A method comprising:

executing, by a first hardware thread, one or more first instructions at a first time instant that modifies a value of a data structure;

executing, by the first hardware thread, a plurality of second instructions at a second time instant that occurs after the first time instant, wherein the plurality of second instructions is different than the one or more first instructions, and wherein the plurality of second instructions is tagged as atomic;

receiving, by a second hardware thread, an interrupt at a third time instant that occurs after the second time instant, wherein the second hardware thread is different than the first hardware thread, and wherein the first hardware thread communicates with the second hardware thread;

responsive to the second hardware thread receiving the interrupt:

pausing, by the first hardware thread, execution of the plurality of second instructions at the third time instant; and

restarting, by the first hardware thread and at a fourth time instant that occurs after the third time instant, execution of the plurality of second instructions from the point at which the Plurality of second instructions was executing at the second time instant prior to the first hardware thread reaching a write memory barrier; and

executing, after the fourth time instant by the first hardware thread, a read instruction after the write memory barrier.

6. The method of claim 5 , wherein the first hardware thread and the different second hardware thread execute on the same physical processor.

7. The method of claim 5 , wherein the first hardware thread and the different second hardware thread execute on different physical processors.

8. The method of claim 5 , wherein the first hardware thread is configured to resume operation on a different physical processor.

9. A non-transitory computer-readable storage medium storing instructions which, when executed by a processor, cause the processor to:

execute, by a first hardware thread, one or more first instructions at a first time instant that modifies a value of a data structure;

execute, by the first hardware thread, a plurality of second instructions at a second time instant that occurs after the first time instant, wherein the plurality of second instructions is different than the one or more first instructions, and wherein the plurality of second instructions is tagged as atomic;

receive, by a second hardware thread, an interrupt at a third time instant that occurs after the second time instant, wherein the second hardware thread is different than the first hardware thread, and wherein the first hardware thread communicates with the second hardware thread;

responsive to the second hardware thread receiving the interrupt:

pause, by the first hardware thread, execution of the plurality of second instructions at the third time instant; and

restart, by the first hardware thread and at a fourth time instant that occurs after the third time instant, execution of the plurality of second instructions from the point at which the plurality of second instructions was executing at the second time instant prior to the first hardware thread reaching a write memory barrier; and

execute, after the fourth time instant and by the first hardware thread, a read instruction after the write memory barrier.

10. The non-transitory computer-readable storage medium of claim 9 , wherein the first hardware thread and the different second hardware thread execute on the same physical processor.

11. The non-transitory computer-readable storage medium of claim 9 , wherein the first hardware thread is configured to resume operation on a different physical processor.

12. The non-transitory computer-readable storage medium of claim 9 , wherein the first hardware thread and the different second hardware thread execute on different physical processors.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 1, 2019
From: TSIRKIN, MICHAEL; ARCANGELI, ANDREA
To: RED HAT, INC.
Reel/Frame 050587/0001 →