Deleted Added
full compact
kern_rmlock.c (241374) kern_rmlock.c (244582)
1/*-
2 * Copyright (c) 2007 Stephan Uphoff <ups@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30/*
31 * Machine independent bits of reader/writer lock implementation.
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Stephan Uphoff <ups@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30/*
31 * Machine independent bits of reader/writer lock implementation.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/kern/kern_rmlock.c 241374 2012-10-09 14:32:30Z attilio $");
35__FBSDID("$FreeBSD: head/sys/kern/kern_rmlock.c 244582 2012-12-22 09:37:34Z attilio $");
36
37#include "opt_ddb.h"
38#include "opt_kdtrace.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42
43#include <sys/kernel.h>
36
37#include "opt_ddb.h"
38#include "opt_kdtrace.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42
43#include <sys/kernel.h>
44#include <sys/kdb.h>
44#include <sys/ktr.h>
45#include <sys/lock.h>
46#include <sys/mutex.h>
47#include <sys/proc.h>
48#include <sys/rmlock.h>
49#include <sys/sched.h>
50#include <sys/smp.h>
51#include <sys/turnstile.h>

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

489#ifdef LOCK_DEBUG
490
491void _rm_wlock_debug(struct rmlock *rm, const char *file, int line)
492{
493
494 if (SCHEDULER_STOPPED())
495 return;
496
45#include <sys/ktr.h>
46#include <sys/lock.h>
47#include <sys/mutex.h>
48#include <sys/proc.h>
49#include <sys/rmlock.h>
50#include <sys/sched.h>
51#include <sys/smp.h>
52#include <sys/turnstile.h>

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

490#ifdef LOCK_DEBUG
491
492void _rm_wlock_debug(struct rmlock *rm, const char *file, int line)
493{
494
495 if (SCHEDULER_STOPPED())
496 return;
497
497 KASSERT(!TD_IS_IDLETHREAD(curthread),
498 KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
498 ("rm_wlock() by idle thread %p on rmlock %s @ %s:%d",
499 curthread, rm->lock_object.lo_name, file, line));
500 WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE,
501 file, line, NULL);
502
503 _rm_wlock(rm);
504
505 LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line);

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

534int
535_rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker,
536 int trylock, const char *file, int line)
537{
538
539 if (SCHEDULER_STOPPED())
540 return (1);
541
499 ("rm_wlock() by idle thread %p on rmlock %s @ %s:%d",
500 curthread, rm->lock_object.lo_name, file, line));
501 WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE,
502 file, line, NULL);
503
504 _rm_wlock(rm);
505
506 LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line);

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

535int
536_rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker,
537 int trylock, const char *file, int line)
538{
539
540 if (SCHEDULER_STOPPED())
541 return (1);
542
542 KASSERT(!TD_IS_IDLETHREAD(curthread),
543 KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
543 ("rm_rlock() by idle thread %p on rmlock %s @ %s:%d",
544 curthread, rm->lock_object.lo_name, file, line));
545 if (!trylock && (rm->lock_object.lo_flags & RM_SLEEPABLE))
546 WITNESS_CHECKORDER(&rm->rm_lock_sx.lock_object, LOP_NEWORDER,
547 file, line, NULL);
548 WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL);
549
550 if (_rm_rlock(rm, tracker, trylock)) {

--- 63 unchanged lines hidden ---
544 ("rm_rlock() by idle thread %p on rmlock %s @ %s:%d",
545 curthread, rm->lock_object.lo_name, file, line));
546 if (!trylock && (rm->lock_object.lo_flags & RM_SLEEPABLE))
547 WITNESS_CHECKORDER(&rm->rm_lock_sx.lock_object, LOP_NEWORDER,
548 file, line, NULL);
549 WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL);
550
551 if (_rm_rlock(rm, tracker, trylock)) {

--- 63 unchanged lines hidden ---