subr_witness.c (122001) | subr_witness.c (122514) |
---|---|
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 122001 2003-11-03 22:38:30Z jhb $"); | 85__FBSDID("$FreeBSD: head/sys/kern/subr_witness.c 122514 2003-11-11 22:07:29Z jhb $"); |
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/kernel.h> 93#include <sys/ktr.h> --- 189 unchanged lines hidden (view full) --- 283 { "sabtty", &lock_class_mtx_spin }, 284 { "zstty", &lock_class_mtx_spin }, 285 { "ng_node", &lock_class_mtx_spin }, 286 { "ng_worklist", &lock_class_mtx_spin }, 287 { "taskqueue_fast", &lock_class_mtx_spin }, 288 { "intr table", &lock_class_mtx_spin }, 289 { "ithread table lock", &lock_class_mtx_spin }, 290 { "sched lock", &lock_class_mtx_spin }, | 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/kernel.h> 93#include <sys/ktr.h> --- 189 unchanged lines hidden (view full) --- 283 { "sabtty", &lock_class_mtx_spin }, 284 { "zstty", &lock_class_mtx_spin }, 285 { "ng_node", &lock_class_mtx_spin }, 286 { "ng_worklist", &lock_class_mtx_spin }, 287 { "taskqueue_fast", &lock_class_mtx_spin }, 288 { "intr table", &lock_class_mtx_spin }, 289 { "ithread table lock", &lock_class_mtx_spin }, 290 { "sched lock", &lock_class_mtx_spin }, |
291 { "turnstile chain", &lock_class_mtx_spin }, 292 { "td_contested", &lock_class_mtx_spin }, |
|
291 { "callout", &lock_class_mtx_spin }, 292 /* 293 * leaf locks 294 */ 295 { "allpmaps", &lock_class_mtx_spin }, 296 { "vm page queue free mutex", &lock_class_mtx_spin }, 297 { "icu", &lock_class_mtx_spin }, 298#ifdef SMP --- 38 unchanged lines hidden (view full) --- 337 338static struct mtx all_mtx = { 339 { &lock_class_mtx_sleep, /* mtx_object.lo_class */ 340 "All locks list", /* mtx_object.lo_name */ 341 "All locks list", /* mtx_object.lo_type */ 342 LO_INITIALIZED, /* mtx_object.lo_flags */ 343 { NULL, NULL }, /* mtx_object.lo_list */ 344 NULL }, /* mtx_object.lo_witness */ | 293 { "callout", &lock_class_mtx_spin }, 294 /* 295 * leaf locks 296 */ 297 { "allpmaps", &lock_class_mtx_spin }, 298 { "vm page queue free mutex", &lock_class_mtx_spin }, 299 { "icu", &lock_class_mtx_spin }, 300#ifdef SMP --- 38 unchanged lines hidden (view full) --- 339 340static struct mtx all_mtx = { 341 { &lock_class_mtx_sleep, /* mtx_object.lo_class */ 342 "All locks list", /* mtx_object.lo_name */ 343 "All locks list", /* mtx_object.lo_type */ 344 LO_INITIALIZED, /* mtx_object.lo_flags */ 345 { NULL, NULL }, /* mtx_object.lo_list */ 346 NULL }, /* mtx_object.lo_witness */ |
345 MTX_UNOWNED, 0, /* mtx_lock, mtx_recurse */ 346 TAILQ_HEAD_INITIALIZER(all_mtx.mtx_blocked), 347 { NULL, NULL } /* mtx_contested */ | 347 MTX_UNOWNED, 0 /* mtx_lock, mtx_recurse */ |
348}; 349 350/* 351 * This global is set to 0 once it becomes safe to use the witness code. 352 */ 353static int witness_cold = 1; 354 355/* --- 1427 unchanged lines hidden --- | 348}; 349 350/* 351 * This global is set to 0 once it becomes safe to use the witness code. 352 */ 353static int witness_cold = 1; 354 355/* --- 1427 unchanged lines hidden --- |