Deleted Added
full compact
subr_witness.c (164033) subr_witness.c (164159)
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

77 * you have two threads T1 and T2 and a sleepable lock X. Suppose that T1
78 * acquires X and blocks on Giant. Then suppose that T2 acquires Giant and
79 * blocks on X. When T2 blocks on X, T2 will release Giant allowing T1 to
80 * execute. Thus, acquiring Giant both before and after a sleepable lock
81 * will not result in a lock order reversal.
82 */
83
84#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

77 * you have two threads T1 and T2 and a sleepable lock X. Suppose that T1
78 * acquires X and blocks on Giant. Then suppose that T2 acquires Giant and
79 * blocks on X. When T2 blocks on X, T2 will release Giant allowing T1 to
80 * execute. Thus, acquiring Giant both before and after a sleepable lock
81 * will not result in a lock order reversal.
82 */
83
84#include <sys/cdefs.h>
85__FBSDID("$FreeBSD: head/sys/kern/subr_witness.c 164033 2006-11-06 13:42:10Z rwatson $");
85__FBSDID("$FreeBSD: head/sys/kern/subr_witness.c 164159 2006-11-11 03:18:07Z kmacy $");
86
87#include "opt_ddb.h"
88#include "opt_witness.h"
89
90#include <sys/param.h>
91#include <sys/bus.h>
92#include <sys/kdb.h>
93#include <sys/kernel.h>

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

477 * We have to release Giant before initializing its witness
478 * structure so that WITNESS doesn't get confused.
479 */
480 mtx_unlock(&Giant);
481 mtx_assert(&Giant, MA_NOTOWNED);
482
483 CTR1(KTR_WITNESS, "%s: initializing witness", __func__);
484 mtx_init(&w_mtx, "witness lock", NULL, MTX_SPIN | MTX_QUIET |
86
87#include "opt_ddb.h"
88#include "opt_witness.h"
89
90#include <sys/param.h>
91#include <sys/bus.h>
92#include <sys/kdb.h>
93#include <sys/kernel.h>

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

477 * We have to release Giant before initializing its witness
478 * structure so that WITNESS doesn't get confused.
479 */
480 mtx_unlock(&Giant);
481 mtx_assert(&Giant, MA_NOTOWNED);
482
483 CTR1(KTR_WITNESS, "%s: initializing witness", __func__);
484 mtx_init(&w_mtx, "witness lock", NULL, MTX_SPIN | MTX_QUIET |
485 MTX_NOWITNESS);
485 MTX_NOWITNESS | MTX_NOPROFILE);
486 for (i = 0; i < WITNESS_COUNT; i++)
487 witness_free(&w_data[i]);
488 for (i = 0; i < WITNESS_CHILDCOUNT; i++)
489 witness_child_free(&w_childdata[i]);
490 for (i = 0; i < LOCK_CHILDCOUNT; i++)
491 witness_lock_list_free(&w_locklistdata[i]);
492
493 /* First add in all the specified order lists. */

--- 1506 unchanged lines hidden ---
486 for (i = 0; i < WITNESS_COUNT; i++)
487 witness_free(&w_data[i]);
488 for (i = 0; i < WITNESS_CHILDCOUNT; i++)
489 witness_child_free(&w_childdata[i]);
490 for (i = 0; i < LOCK_CHILDCOUNT; i++)
491 witness_lock_list_free(&w_locklistdata[i]);
492
493 /* First add in all the specified order lists. */

--- 1506 unchanged lines hidden ---