Deleted Added
full compact
kern_synch.c (228234) kern_synch.c (228424)
1/*-
2 * Copyright (c) 1982, 1986, 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 228234 2011-12-03 15:51:15Z hselasky $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 228424 2011-12-11 21:02:01Z avg $");
39
40#include "opt_ktrace.h"
41#include "opt_sched.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/condvar.h>
46#include <sys/kdb.h>

--- 106 unchanged lines hidden (view full) ---

153 if (priority & PDROP)
154 KASSERT(lock != NULL && lock != &Giant.lock_object,
155 ("PDROP requires a non-Giant lock"));
156 if (lock != NULL)
157 class = LOCK_CLASS(lock);
158 else
159 class = NULL;
160
39
40#include "opt_ktrace.h"
41#include "opt_sched.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/condvar.h>
46#include <sys/kdb.h>

--- 106 unchanged lines hidden (view full) ---

153 if (priority & PDROP)
154 KASSERT(lock != NULL && lock != &Giant.lock_object,
155 ("PDROP requires a non-Giant lock"));
156 if (lock != NULL)
157 class = LOCK_CLASS(lock);
158 else
159 class = NULL;
160
161 if (cold) {
161 if (cold || SCHEDULER_STOPPED()) {
162 /*
163 * During autoconfiguration, just return;
164 * don't run any other threads or panic below,
165 * in case this is the idle thread and already asleep.
166 * XXX: this used to do "s = splhigh(); splx(safepri);
167 * splx(s);" to give interrupts a chance, but there is
168 * no way to give interrupts a chance now.
169 */

--- 85 unchanged lines hidden (view full) ---

255 WITNESS_SAVE_DECL(mtx);
256
257 td = curthread;
258 p = td->td_proc;
259 KASSERT(mtx != NULL, ("sleeping without a mutex"));
260 KASSERT(p != NULL, ("msleep1"));
261 KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
262
162 /*
163 * During autoconfiguration, just return;
164 * don't run any other threads or panic below,
165 * in case this is the idle thread and already asleep.
166 * XXX: this used to do "s = splhigh(); splx(safepri);
167 * splx(s);" to give interrupts a chance, but there is
168 * no way to give interrupts a chance now.
169 */

--- 85 unchanged lines hidden (view full) ---

255 WITNESS_SAVE_DECL(mtx);
256
257 td = curthread;
258 p = td->td_proc;
259 KASSERT(mtx != NULL, ("sleeping without a mutex"));
260 KASSERT(p != NULL, ("msleep1"));
261 KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
262
263 if (cold) {
263 if (cold || SCHEDULER_STOPPED()) {
264 /*
265 * During autoconfiguration, just return;
266 * don't run any other threads or panic below,
267 * in case this is the idle thread and already asleep.
268 * XXX: this used to do "s = splhigh(); splx(safepri);
269 * splx(s);" to give interrupts a chance, but there is
270 * no way to give interrupts a chance now.
271 */

--- 152 unchanged lines hidden (view full) ---

424 ("mi_switch: switch must be voluntary or involuntary"));
425 KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself"));
426
427 /*
428 * Don't perform context switches from the debugger.
429 */
430 if (kdb_active)
431 kdb_switch();
264 /*
265 * During autoconfiguration, just return;
266 * don't run any other threads or panic below,
267 * in case this is the idle thread and already asleep.
268 * XXX: this used to do "s = splhigh(); splx(safepri);
269 * splx(s);" to give interrupts a chance, but there is
270 * no way to give interrupts a chance now.
271 */

--- 152 unchanged lines hidden (view full) ---

424 ("mi_switch: switch must be voluntary or involuntary"));
425 KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself"));
426
427 /*
428 * Don't perform context switches from the debugger.
429 */
430 if (kdb_active)
431 kdb_switch();
432 if (SCHEDULER_STOPPED())
433 return;
432 if (flags & SW_VOL) {
433 td->td_ru.ru_nvcsw++;
434 td->td_swvoltick = ticks;
435 } else
436 td->td_ru.ru_nivcsw++;
437#ifdef SCHED_STATS
438 SCHED_STAT_INC(sched_switch_stats[flags & SW_TYPE_MASK]);
439#endif

--- 165 unchanged lines hidden ---
434 if (flags & SW_VOL) {
435 td->td_ru.ru_nvcsw++;
436 td->td_swvoltick = ticks;
437 } else
438 td->td_ru.ru_nivcsw++;
439#ifdef SCHED_STATS
440 SCHED_STAT_INC(sched_switch_stats[flags & SW_TYPE_MASK]);
441#endif

--- 165 unchanged lines hidden ---