1
0
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:
John Baldwin 2008-01-17 18:59:38 +00:00
parent 6634dbbde4
commit c05655bfda
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175405
3 changed files with 3 additions and 0 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();