subr_witness.c (68790) | subr_witness.c (68808) |
---|---|
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. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ | 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. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ |
30 * $FreeBSD: head/sys/kern/subr_witness.c 68790 2000-11-15 22:08:16Z jhb $ | 30 * $FreeBSD: head/sys/kern/subr_witness.c 68808 2000-11-16 02:16:44Z jhb $ |
31 */ 32 33/* 34 * Main Entry: witness 35 * Pronunciation: 'wit-n&s 36 * Function: noun 37 * Etymology: Middle English witnesse, from Old English witnes knowledge, 38 * testimony, witness, from 2wit --- 179 unchanged lines hidden (view full) --- 218 p, p1, m, m->mtx_description); 219 } 220} 221 222void 223mtx_enter_hard(struct mtx *m, int type, int saveintr) 224{ 225 struct proc *p = CURPROC; | 31 */ 32 33/* 34 * Main Entry: witness 35 * Pronunciation: 'wit-n&s 36 * Function: noun 37 * Etymology: Middle English witnesse, from Old English witnes knowledge, 38 * testimony, witness, from 2wit --- 179 unchanged lines hidden (view full) --- 218 p, p1, m, m->mtx_description); 219 } 220} 221 222void 223mtx_enter_hard(struct mtx *m, int type, int saveintr) 224{ 225 struct proc *p = CURPROC; |
226 struct timeval new_switchtime; | |
227 228 KASSERT(p != NULL, ("curproc is NULL in mutex")); 229 230 switch (type) { 231 case MTX_DEF: 232 if ((m->mtx_lock & MTX_FLAGMASK) == (uintptr_t)p) { 233 m->mtx_recurse++; 234 atomic_set_ptr(&m->mtx_lock, MTX_RECURSE); --- 83 unchanged lines hidden (view full) --- 318 319 p->p_blocked = m; /* Who we're blocked on */ 320 p->p_stat = SMTX; 321#if 0 322 propagate_priority(p); 323#endif 324 CTR3(KTR_LOCK, "mtx_enter: p 0x%p blocked on [0x%p] %s", 325 p, m, m->mtx_description); | 226 227 KASSERT(p != NULL, ("curproc is NULL in mutex")); 228 229 switch (type) { 230 case MTX_DEF: 231 if ((m->mtx_lock & MTX_FLAGMASK) == (uintptr_t)p) { 232 m->mtx_recurse++; 233 atomic_set_ptr(&m->mtx_lock, MTX_RECURSE); --- 83 unchanged lines hidden (view full) --- 317 318 p->p_blocked = m; /* Who we're blocked on */ 319 p->p_stat = SMTX; 320#if 0 321 propagate_priority(p); 322#endif 323 CTR3(KTR_LOCK, "mtx_enter: p 0x%p blocked on [0x%p] %s", 324 p, m, m->mtx_description); |
326 /* 327 * Blatantly copied from mi_switch nearly verbatim. 328 * When Giant goes away and we stop dinking with it 329 * in mi_switch, we can go back to calling mi_switch 330 * directly here. 331 */ 332 333 /* 334 * Compute the amount of time during which the current 335 * process was running, and add that to its total so 336 * far. 337 */ 338 microuptime(&new_switchtime); 339 if (timevalcmp(&new_switchtime, &switchtime, <)) { 340 printf( 341 "microuptime() went backwards (%ld.%06ld -> %ld.%06ld)\n", 342 switchtime.tv_sec, switchtime.tv_usec, 343 new_switchtime.tv_sec, 344 new_switchtime.tv_usec); 345 new_switchtime = switchtime; 346 } else { 347 p->p_runtime += (new_switchtime.tv_usec - 348 switchtime.tv_usec) + 349 (new_switchtime.tv_sec - switchtime.tv_sec) * 350 (int64_t)1000000; 351 } 352 353 /* 354 * Pick a new current process and record its start time. 355 */ 356 cnt.v_swtch++; 357 switchtime = new_switchtime; 358 cpu_switch(); 359 if (switchtime.tv_sec == 0) 360 microuptime(&switchtime); 361 switchticks = ticks; | 325 mi_switch(); |
362 CTR3(KTR_LOCK, 363 "mtx_enter: p 0x%p free from blocked on [0x%p] %s", 364 p, m, m->mtx_description); 365 mtx_exit(&sched_lock, MTX_SPIN); 366 } 367 return; 368 case MTX_SPIN: 369 case MTX_SPIN | MTX_FIRST: --- 360 unchanged lines hidden (view full) --- 730 731static char *ignore_list[] = { 732 "witness lock", 733 NULL 734}; 735 736static char *spin_order_list[] = { 737 "sched lock", | 326 CTR3(KTR_LOCK, 327 "mtx_enter: p 0x%p free from blocked on [0x%p] %s", 328 p, m, m->mtx_description); 329 mtx_exit(&sched_lock, MTX_SPIN); 330 } 331 return; 332 case MTX_SPIN: 333 case MTX_SPIN | MTX_FIRST: --- 360 unchanged lines hidden (view full) --- 694 695static char *ignore_list[] = { 696 "witness lock", 697 NULL 698}; 699 700static char *spin_order_list[] = { 701 "sched lock", |
738 "clk", | |
739 "sio", | 702 "sio", |
703#ifdef __i386__ 704 "clk", 705#endif |
|
740 /* 741 * leaf locks 742 */ 743 NULL 744}; 745 746static char *order_list[] = { 747 NULL 748}; 749 750static char *dup_list[] = { 751 NULL 752}; 753 754static char *sleep_list[] = { | 706 /* 707 * leaf locks 708 */ 709 NULL 710}; 711 712static char *order_list[] = { 713 NULL 714}; 715 716static char *dup_list[] = { 717 NULL 718}; 719 720static char *sleep_list[] = { |
755 "Giant lock", | |
756 NULL 757}; 758 759/* 760 * Pairs of locks which have been blessed 761 * Don't complain about order problems with blessed locks 762 */ 763static struct witness_blessed blessed_list[] = { --- 597 unchanged lines hidden --- | 721 NULL 722}; 723 724/* 725 * Pairs of locks which have been blessed 726 * Don't complain about order problems with blessed locks 727 */ 728static struct witness_blessed blessed_list[] = { --- 597 unchanged lines hidden --- |