From owner-p4-projects@FreeBSD.ORG Fri Jan 25 01:52:53 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DCCDF16A41A; Fri, 25 Jan 2008 01:52:52 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A20E16A469 for ; Fri, 25 Jan 2008 01:52:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7689F13C4CE for ; Fri, 25 Jan 2008 01:52:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0P1qoXm048936 for ; Fri, 25 Jan 2008 01:52:50 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0P1qoV4048933 for perforce@freebsd.org; Fri, 25 Jan 2008 01:52:50 GMT (envelope-from jhb@freebsd.org) Date: Fri, 25 Jan 2008 01:52:50 GMT Message-Id: <200801250152.m0P1qoV4048933@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 134050 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2008 01:52:53 -0000 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);