mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().
MFC after: 1 week
This commit is contained in:
parent
6634dbbde4
commit
c05655bfda
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175405
@ -286,6 +286,7 @@ DELAY(int n)
|
||||
start = rdtsc();
|
||||
end = start + (tsc_freq * n) / 1000000;
|
||||
do {
|
||||
cpu_spinwait();
|
||||
now = rdtsc();
|
||||
} while (now < end || (now > start && end < start));
|
||||
sched_unpin();
|
||||
|
@ -291,6 +291,7 @@ DELAY(int n)
|
||||
start = rdtsc();
|
||||
end = start + (tsc_freq * n) / 1000000;
|
||||
do {
|
||||
cpu_spinwait();
|
||||
now = rdtsc();
|
||||
} while (now < end || (now > start && end < start));
|
||||
sched_unpin();
|
||||
|
@ -291,6 +291,7 @@ DELAY(int n)
|
||||
start = rdtsc();
|
||||
end = start + (tsc_freq * n) / 1000000;
|
||||
do {
|
||||
cpu_spinwait();
|
||||
now = rdtsc();
|
||||
} while (now < end || (now > start && end < start));
|
||||
sched_unpin();
|
||||
|
Loading…
Reference in New Issue
Block a user