subr_witness.c (217916) | subr_witness.c (218909) |
---|---|
1/*- 2 * Copyright (c) 2008 Isilon Systems, Inc. 3 * Copyright (c) 2008 Ilya Maykov <ivmaykov@gmail.com> 4 * Copyright (c) 1998 Berkeley Software Design, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 71 unchanged lines hidden (view full) --- 80 * you have two threads T1 and T2 and a sleepable lock X. Suppose that T1 81 * acquires X and blocks on Giant. Then suppose that T2 acquires Giant and 82 * blocks on X. When T2 blocks on X, T2 will release Giant allowing T1 to 83 * execute. Thus, acquiring Giant both before and after a sleepable lock 84 * will not result in a lock order reversal. 85 */ 86 87#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Isilon Systems, Inc. 3 * Copyright (c) 2008 Ilya Maykov <ivmaykov@gmail.com> 4 * Copyright (c) 1998 Berkeley Software Design, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 71 unchanged lines hidden (view full) --- 80 * you have two threads T1 and T2 and a sleepable lock X. Suppose that T1 81 * acquires X and blocks on Giant. Then suppose that T2 acquires Giant and 82 * blocks on X. When T2 blocks on X, T2 will release Giant allowing T1 to 83 * execute. Thus, acquiring Giant both before and after a sleepable lock 84 * will not result in a lock order reversal. 85 */ 86 87#include <sys/cdefs.h> |
88__FBSDID("$FreeBSD: head/sys/kern/subr_witness.c 217916 2011-01-27 00:34:12Z mdf $"); | 88__FBSDID("$FreeBSD: head/sys/kern/subr_witness.c 218909 2011-02-21 09:01:34Z brucec $"); |
89 90#include "opt_ddb.h" 91#include "opt_hwpmc_hooks.h" 92#include "opt_stack.h" 93#include "opt_witness.h" 94 95#include <sys/param.h> 96#include <sys/bus.h> --- 1073 unchanged lines hidden (view full) --- 1170 witness_debugger(1); 1171 } else 1172 mtx_unlock_spin(&w_mtx); 1173 return; 1174 } 1175 mtx_assert(&w_mtx, MA_OWNED); 1176 1177 /* | 89 90#include "opt_ddb.h" 91#include "opt_hwpmc_hooks.h" 92#include "opt_stack.h" 93#include "opt_witness.h" 94 95#include <sys/param.h> 96#include <sys/bus.h> --- 1073 unchanged lines hidden (view full) --- 1170 witness_debugger(1); 1171 } else 1172 mtx_unlock_spin(&w_mtx); 1173 return; 1174 } 1175 mtx_assert(&w_mtx, MA_OWNED); 1176 1177 /* |
1178 * If we know that the the lock we are acquiring comes after | 1178 * If we know that the lock we are acquiring comes after |
1179 * the lock we most recently acquired in the lock order tree, 1180 * then there is no need for any further checks. 1181 */ 1182 if (isitmychild(w1, w)) 1183 goto out; 1184 1185 for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) { 1186 for (i = lle->ll_count - 1; i >= 0; i--, j++) { --- 1617 unchanged lines hidden --- | 1179 * the lock we most recently acquired in the lock order tree, 1180 * then there is no need for any further checks. 1181 */ 1182 if (isitmychild(w1, w)) 1183 goto out; 1184 1185 for (j = 0, lle = lock_list; lle != NULL; lle = lle->ll_next) { 1186 for (i = lle->ll_count - 1; i >= 0; i--, j++) { --- 1617 unchanged lines hidden --- |