PERFORCE change 134050 for review
John Baldwin
jhb at FreeBSD.org
Thu Jan 24 17:52:53 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=134050
Change 134050 by jhb at jhb_mutex on 2008/01/25 01:52:21
Bind to CPU 1 so softclock can run concurrently.
Affected files ...
.. //depot/projects/smpng/sys/modules/crash/crash.c#45 edit
Differences ...
==== //depot/projects/smpng/sys/modules/crash/crash.c#45 (text+ko) ====
@@ -105,15 +105,24 @@
struct callout c;
struct bintime start, finish;
struct timeval elapsed;
+ struct thread *td;
int rval;
/*
+ * Bind to CPU 1 so that softclock can run ok on CPU 0.
+ */
+ td = curthread;
+ thread_lock(td);
+ sched_bind(td, 1);
+ thread_unlock(td);
+ callout_init(&c, CALLOUT_MPSAFE);
+ callout_reset(&c, 5 * hz, tsleep_race_fallback, NULL);
+
+ /*
* Inline copy of tsleep() with a long DELAY() to open up the
* race window where the thread lock is dropped in between
* sleepq_add() and sleepq_*wait*().
*/
- callout_init(&c, CALLOUT_MPSAFE);
- callout_reset(&c, 5 * hz, tsleep_race_fallback, NULL);
binuptime(&start);
sleepq_lock(&race_wchan);
DROP_GIANT();
@@ -122,6 +131,9 @@
DELAY(2 * 1000 * 1000);
rval = sleepq_timedwait(&race_wchan);
binuptime(&finish);
+ thread_lock(td);
+ sched_unbind(td);
+ thread_unlock(td);
PICKUP_GIANT();
printf("crash: sleepq_timedwait() returned %d\n", rval);
bintime_sub(&finish, &start);
More information about the p4-projects
mailing list