Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2008 01:52:50 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134050 for review
Message-ID:  <200801250152.m0P1qoV4048933@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134050

Change 134050 by jhb@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801250152.m0P1qoV4048933>