Skip to content

Commit 09a00ec

Browse files
authored
Move Zihintpause rationale to appendix (#2371)
Fixes #2370
1 parent 8df581f commit 09a00ec

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/rationale.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ the rationale will be added over time.
1212
In cases where the rationale was not recorded, the authors and editors will
1313
synthesize it from the historical record.
1414

15+
=== "Zihintpause" Extension for Pause Hint
16+
17+
The PAUSE instruction hints to a hart that it should temporarily reduce its
18+
rate of execution.
19+
It is normally used to save energy and execution resources while polling, e.g.
20+
while waiting for a spinlock to become free.
21+
22+
Much of the debate surrounding this extension centered on whether a facility
23+
similar to x86's MONITOR/MWAIT should instead be provided.
24+
We concluded that, even if such a facility were to be defined for RISC-V,
25+
it would not supplant PAUSE.
26+
PAUSE is more appropriate when polling for non-memory events, when polling for
27+
multiple events, or when software does not know precisely what events it is
28+
polling for.
29+
(Perhaps surprisingly, the latter case is ubiquitous, in part because it is
30+
the mechanism expected by the Linux kernel's `cpu_relax` API.)
31+
1532
=== "Zicond" Extension for Integer Conditional Operations
1633

1734
Replacing unpredictable branches with conditional-select or conditional-move

src/zihintpause.adoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ executed. It is recommended that a PAUSE instruction generally be
1515
included in the code sequence for a spin-wait loop.
1616
(((PAUSE, energy consumption)))
1717
18-
A future extension might add primitives similar to the x86 MONITOR/MWAIT
19-
instructions, which provide a more efficient mechanism to wait on writes
20-
to a specific memory location. However, these instructions would not
21-
supplant PAUSE. PAUSE is more appropriate when polling for non-memory
22-
events, when polling for multiple events, or when software does not know
23-
precisely what events it is polling for.
24-
2518
The duration of a PAUSE instruction's effect may vary significantly
2619
within and among implementations. In typical implementations this
2720
duration should be much less than the time to perform a context switch,

0 commit comments

Comments
 (0)