Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/subr_lockdebug.c
RevisionDateAuthorComments
 1.83  02-Sep-2022  nakayama Fix "error: cast from pointer to integer of different size" on
sparc build.
 1.82  31-Aug-2022  msaitoh Fix previous to make it compile again.
 1.81  30-Aug-2022  riastradh lockdebug(9): Try to show symbol names if possible.

Also print the possible owner in ddb/crash `show lock' even if the
kernel is built without LOCKDEBUG.

Output may not be as pretty before with two neatly aligned columns,
but that can be changed; for now the value of having the symbols
printed instead of just obscure hex addresses (which one's an lwp
address and which one's a code pointer? can never remember!) should
outweigh the prettiness temporarily lost.
 1.80  02-Mar-2021  rin KNF. No binary changes.
 1.79  01-Jan-2021  riastradh Use printf, not printf_nolog, in lockdebug dumps.

Otherwise we get no diagnostic information in crash dumps or dmesg,
which really puts a damper on the utility of lockdebug.

(If there's a reason for printf_nolog instead of printf, it should be
documented in comments here, and it had better be a pretty good
reason for destroying the diagnostic information that is half the
point of lockdebug.)
 1.78  01-Jan-2021  riastradh Nix trailing whitespace.
 1.77  15-May-2020  maxv branches: 1.77.2;
Introduce kcov_silence_enter() and kcov_silence_leave(), to allow to
temporarily disable KCOV on the current lwp. Should be used in the rare
but problematic cases where extreme noise is introduced by an
uninteresting subsystem.

Use this capability to silence KCOV during the LOCKDEBUG lookups. This
divides the size of the KCOV output by more than two in my KCOV+vHCI
tests.
 1.76  10-Apr-2020  ad - Make this needed sequence always work for condvars, by not touching the CV
again after wakeup. Previously it could panic because cv_signal() could
be called by cv_wait_sig() + others:

cv_broadcast(cv);
cv_destroy(cv);

- In support of the above, if an LWP doing a timed wait is awoken by
cv_broadcast() or cv_signal(), don't return an error if the timer
fires after the fact, i.e. either succeed or fail, not both.

- Remove LOCKDEBUG code for CVs which never worked properly and is of
questionable use.
 1.75  09-Mar-2020  christos branches: 1.75.2;
comment out enough stuff to allow crash to print locks.
 1.74  21-Jan-2020  ad ddb's "show all locks":

- Make the output easier to scan quickly.

- Show every LWP that is blocked on a lock, and the details of the lock.
 1.73  08-Jan-2020  ad lockdebug_barrier(): allow the one permitted lock to be a sleep lock too.
 1.72  28-May-2019  ryo branches: 1.72.4;
changes of r1.68 was reverted by r1.69. apply it again.
 1.71  22-May-2019  scole Increase LD_BATCH_SHIFT for ia64 LOCKDEBUG kernels. Otherwise, ia64 pmap will run out of space with this kernel debug option enabled.

Discussed with <chs> over email.
 1.70  09-May-2019  ozaki-r Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb:

db{0}> show all locks/t
[Locks tracked through LWPs]
Locks held by an LWP (iperf):
Lock 0 (initialized at soinit)
lock address : 0xffffedeb84b06080 type : sleep/adaptive
initialized : 0xffffffff806d8c3f
shared holds : 0 exclusive: 1
shares wanted: 0 exclusive: 11
current cpu : 0 last held: 1
current lwp : 0xffffedeb849ff040 last held: 0xffffedeb7dfdb240
last locked* : 0xffffffff806d8335 unlocked : 0xffffffff806d8385
[ 79103.0868574] owner field : 0xffffedeb7dfdb240 wait/spin: 1/0

Fix it by passing a printer function to lo_dump functions, i.e., make the
functions use db_printf on ddb.
 1.69  03-Nov-2018  christos Deduplicate debug printing code.
 1.68  25-Oct-2018  mrg in the !MP world, ci->ci_curlwp may not exist. just use curlwp.

XXX: can we just do this for MP builds, too? i think so.
 1.67  13-Sep-2018  mrg always call lockdebug_dismiss() from DDB -- there are always some
minimal lockdebug checks in place, even without LOCKDEBUG.

adjust lockdebug_abort() to ignore problems after ld_panic is set
so that there's a chance of this working.

this fixes ddb 'reboot' on softiron od1000.
 1.66  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.65  12-Aug-2018  mrg add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts. use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.
 1.64  19-Mar-2018  ozaki-r branches: 1.64.2;
ddb: rename "show lockstat" to "show lockstats" to avoid conflicting with lockstat(8)

Requested by mrg@
 1.63  16-Mar-2018  ozaki-r Get rid of a redundant output
 1.62  16-Mar-2018  ozaki-r Add a new command, show all locks, which shows information of active locks

The command shows information of all active (i.e., being held) locks that are
tracked through either of LWPs or CPUs by the LOCKDEBUG facility. The /t
modifier additionally shows a backtrace for each LWP additionally. This
feature is useful for debugging especially to analyze deadlocks.

The command is useful only if LOCKDEBUG is enabled.
 1.61  16-Mar-2018  ozaki-r Add a new command, show lockstat, which shows statistics of locks

Currently the command shows the number of allocated locks.

The command is useful only if LOCKDEBUG is enabled.
 1.60  20-Feb-2018  ozaki-r branches: 1.60.2;
Spinkle __predict_false to LOCKDEBUG functions

Panics and lockdebug failures are unlikely to occur normally.
 1.59  14-Feb-2018  ozaki-r Use cpu_softintr_p
 1.58  16-Sep-2017  christos more const
 1.57  01-Jun-2017  chs branches: 1.57.2;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.56  01-May-2017  pgoyette Introduce mutex_ownable() to determine if it is possible for the current
process to acquire a mutex.
 1.55  26-Jan-2017  christos branches: 1.55.4;
For LOCKDEBUG:
Always provide the location of the caller of the lock as __func__, __LINE__.
 1.54  29-Sep-2015  ozaki-r branches: 1.54.2; 1.54.4;
Add _KERNEL_OPT

It's needed for nbmake RUMP_LOCKDEBUG=yes.
 1.53  15-Apr-2015  riastradh Put the lock error info in the panicstr so ddb can get at it.
 1.52  24-Nov-2014  christos branches: 1.52.2;
Print the shared lock(s) before we panic, to aid with debugging.
 1.51  07-Mar-2014  matt Tell where the corrruption was encountered in the panic message.
 1.50  12-Oct-2013  christos provide a better printf for the panic message
 1.49  27-Apr-2013  mlelstv branches: 1.49.4;
Revert change that allowed rw_tryenter(&lock, RW_READER) to recurse
for vfs_busy(). This is no longer necessary.
 1.48  09-Feb-2013  njoly Fix LOCKDEBUG build.
 1.47  09-Feb-2013  christos printflike maintenance.
 1.46  04-Aug-2012  christos branches: 1.46.2;
- fix typo in comment
- Don't call abort1 with NULL ld, after panic(9).
 1.45  26-Jul-2011  yamt branches: 1.45.2;
try to fill ld_locked/ld_unlocked for shared acquisition of lock
 1.44  14-Apr-2011  matt rearrange some common code in lockdebug_unlocked.
When printing a lockdebug error, add a '*' to indicate whether lock or
unlock was performed.
 1.43  25-Sep-2010  matt branches: 1.43.2;
Rename rb.h to rbtree.h, as it is more appropriate (c.f. ptree.h). Also
helps find code that hasn't been updated to use the new rbtree API.
 1.42  24-Sep-2010  rmind Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
already existing one.
4. Amend the interface to manipulate the actual object, instead of the
rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@
 1.41  03-Nov-2009  dyoung branches: 1.41.2; 1.41.4;
Make lockdebug_lock_print(NULL, ...) dump all locks. Now, in ddb,
'show lock 0x0' dumps all of the locks.

XXX I still need to fix 'show all lock'.
 1.40  05-Oct-2009  rmind Convert cpu_number(), which can be sparse, to cpu_index(), which is MI.
 1.39  07-Nov-2008  cegger buildfix: use PRIxPTR rather %lx.
 1.38  07-Nov-2008  rafal Pass / log return address in a few more places; proposed on tech-kern and
ok'd by ad@ about 6 months ago.
 1.37  30-Jun-2008  matt branches: 1.37.2; 1.37.4;
Change tree op members/typedefs to rbto_compare_* from rb_compare_*
 1.36  04-Jun-2008  ad branches: 1.36.2;
Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header
files.
 1.35  31-May-2008  ad LOCKDEBUG:

- Tweak it so it can also catch common errors with condition variables.
The change to kern_condvar.c is not included in this commit and will
come later.

- Don't call kmem_alloc() if operating in interrupt context, just fail
the allocation and disable debugging for the object. Makes it safe
to do mutex_init/rw_init/cv_init in interrupt context, when running
a LOCKDEBUG kernel.
 1.34  06-May-2008  ad branches: 1.34.2;
LOCKDEBUG: try to speed it up a bit by not using so much global state.

This will break the build briefly but will be followed by another commit
to fix that..
 1.33  06-May-2008  ad Allow rw_tryenter(&lock, RW_READER) to recurse, for vfs_busy().
 1.32  03-May-2008  yamt lockdebug: try to detect recursive acquirements of read-write locks.
 1.31  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.30  27-Apr-2008  ad branches: 1.30.2;
lockdebug_barrier: disable preemption using the interrupt priority level,
not crit_enter/crit_exit. Since this is called from mi_switch(), crit_exit
could recurse and skew statistics.
 1.29  27-Mar-2008  ad branches: 1.29.2;
Replace use of CACHE_LINE_SIZE in some obvious places.
 1.28  18-Feb-2008  ad branches: 1.28.6;
Make it compile if !LOCKDEBUG.
 1.27  18-Feb-2008  ad Try to prevent more than one CPUs panicing when an error is detected.
 1.26  05-Jan-2008  ad Need sys/lock.h for SPINLOCK_SPIN_HOOK.
 1.25  04-Jan-2008  ad Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
 1.24  26-Dec-2007  ad Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.
 1.23  08-Dec-2007  ad branches: 1.23.4;
Merge changes from vmlocking2 branch.
 1.22  30-Nov-2007  ad branches: 1.22.2;
Use membar_*().
 1.21  26-Nov-2007  yamt lockdebug_mem_check: turn a redundant check into a panic.
 1.20  22-Nov-2007  yamt fix lockdebug_mem_check.
 1.19  21-Nov-2007  yamt lockdebug_alloc: detect double initialization explicitly.
 1.18  21-Nov-2007  yamt re-enable lockdebug_mem_check. ad@ said disabling it was a mistake
in the first place.
the implementation has been changed to use rb-tree rather than hash
so that it can check regions larger than page size as well.
 1.17  21-Nov-2007  yamt remove #if 0'ed code.
 1.16  21-Nov-2007  yamt make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
 1.15  12-Nov-2007  matt Don't static init simplelock (back out those changes).
 1.14  12-Nov-2007  matt use __SIMPLELOCK_UNLOCKED, not SIMPLELOCK_INITIALIZER
 1.13  11-Nov-2007  matt Change some initialization of static queues to compile time.
(xxx_INIT to xxx_HEAD_INITIALIZER). Drop code which inits
non-auto (global or static) variables to 0 since that's
already implied by being non-auto. Init some static/global
cpu_simple_locks at compile time.
 1.12  06-Nov-2007  ad Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
number and type of priority levels into bands. Add new bands like
'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.
 1.11  27-Oct-2007  ad branches: 1.11.2;
Fix spelling.
 1.10  11-Oct-2007  ad branches: 1.10.2;
Merge from vmlocking:

- G/C spinlockmgr() and simple_lock debugging.
- Always include the kernel_lock functions, for LKMs.
- Slightly improved subr_lockdebug code.
- Keep sizeof(struct lock) the same if LOCKDEBUG.
 1.9  21-Sep-2007  dsl branches: 1.9.2;
Include sys/cdefs.h first.
 1.8  15-Jun-2007  ad branches: 1.8.6; 1.8.8;
splstatclock, spllock -> splhigh
 1.7  21-May-2007  skrll Correct comment.
 1.6  02-May-2007  yamt lockdebug_abort: s/int/u_int/ for lock id as the rest of code.
 1.5  10-Mar-2007  ad branches: 1.5.2; 1.5.4; 1.5.6;
lockdebug:

- Initialize on the first allocation.
- Handle overflow better. PR kern/35723.
 1.4  22-Feb-2007  thorpej branches: 1.4.2;
TRUE -> true, FALSE -> false
 1.3  21-Feb-2007  thorpej Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.2  09-Feb-2007  ad branches: 1.2.2;
Merge newlock2 to head.
 1.1  20-Oct-2006  ad branches: 1.1.2;
file subr_lockdebug.c was initially added on branch newlock2.
 1.1.2.12  06-Feb-2007  ad Revert accidentally commited change.
 1.1.2.11  06-Feb-2007  ad Quieten noisy boot messages.
 1.1.2.10  05-Feb-2007  ad - Dump the contents of a lock's turnstile when an error is detected.
- Add a 'show lock' command to DDB.
 1.1.2.9  04-Feb-2007  ad lockdebug_wantlock(): catch shared->exclusive deadlocks too.
 1.1.2.8  03-Feb-2007  ad Play nicer when the system is panicing/cold.
 1.1.2.7  31-Jan-2007  ad Catch deadlocks earlier.
 1.1.2.6  19-Jan-2007  ad Remove a couple of mostly pointless tests.
 1.1.2.5  29-Dec-2006  ad Checkpoint work in progress.
 1.1.2.4  18-Nov-2006  ad Sync with head.
 1.1.2.3  17-Nov-2006  ad Checkpoint work in progress.
 1.1.2.2  24-Oct-2006  ad Compile fixes
 1.1.2.1  20-Oct-2006  ad Add some LOCKDEBUG code to be shared between mutexes/rwlocks.
 1.2.2.3  07-May-2007  yamt sync with head.
 1.2.2.2  12-Mar-2007  rmind Sync with HEAD.
 1.2.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.4.2.8  27-Feb-2008  yamt sync with head.
 1.4.2.7  21-Jan-2008  yamt sync with head
 1.4.2.6  07-Dec-2007  yamt sync with head
 1.4.2.5  15-Nov-2007  yamt sync with head.
 1.4.2.4  27-Oct-2007  yamt sync with head.
 1.4.2.3  03-Sep-2007  yamt sync with head.
 1.4.2.2  26-Feb-2007  yamt sync with head.
 1.4.2.1  22-Feb-2007  yamt file subr_lockdebug.c was added on branch yamt-lazymbuf on 2007-02-26 09:11:14 +0000
 1.5.6.1  09-Dec-2007  reinoud Pullup to HEAD
 1.5.4.1  11-Jul-2007  mjf Sync with head.
 1.5.2.9  18-Oct-2007  ad Update for soft interrupt changes. See kern_softint.c 1.1.2.17 for details.
 1.5.2.8  11-Oct-2007  ad Sync with head.
 1.5.2.7  20-Aug-2007  ad Disable freed lock checking for now. It seems to be coming up with
false positives.
 1.5.2.6  20-Aug-2007  ad Track where locks were initialized.
 1.5.2.5  29-Jul-2007  ad Trap free() of areas that contain undestroyed locks. Not a major problem
but it helps to catch bugs.
 1.5.2.4  15-Jul-2007  ad Get pmax working.
 1.5.2.3  15-Jul-2007  ad Sync with head.
 1.5.2.2  17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.5.2.1  08-Jun-2007  ad Sync with head.
 1.8.8.3  23-Mar-2008  matt sync with HEAD
 1.8.8.2  09-Jan-2008  matt sync with HEAD
 1.8.8.1  06-Nov-2007  matt sync with HEAD
 1.8.6.9  09-Dec-2007  jmcneill Sync with HEAD.
 1.8.6.8  03-Dec-2007  joerg Sync with HEAD.
 1.8.6.7  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.8.6.6  21-Nov-2007  joerg Sync with HEAD.
 1.8.6.5  14-Nov-2007  joerg Sync with HEAD.
 1.8.6.4  06-Nov-2007  joerg Sync with HEAD.
 1.8.6.3  28-Oct-2007  joerg Sync with HEAD.
 1.8.6.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.8.6.1  02-Oct-2007  joerg Sync with HEAD.
 1.9.2.1  14-Oct-2007  yamt sync with head.
 1.10.2.3  22-Nov-2007  bouyer Sync with HEAD
 1.10.2.2  21-Nov-2007  bouyer Sync with HEAD
 1.10.2.1  13-Nov-2007  bouyer Sync with HEAD
 1.11.2.4  18-Feb-2008  mjf Sync with HEAD.
 1.11.2.3  27-Dec-2007  mjf Sync with HEAD.
 1.11.2.2  08-Dec-2007  mjf Sync with HEAD.
 1.11.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.22.2.8  26-Dec-2007  ad Sync with head.
 1.22.2.7  13-Dec-2007  yamt lockdebug_mem_check: fix "allocation contains active lock" after another panic.
the rb tree can be stale if panicstr != 0 because lockdebug_free is no-op
in that case. might be related to PR/37531 from Andrew Doran.
 1.22.2.6  08-Dec-2007  ad Sync with head.
 1.22.2.5  08-Dec-2007  ad Reduce unnecessary diffs to HEAD.
 1.22.2.4  05-Dec-2007  ad Add memory barriers to previous.
 1.22.2.3  05-Dec-2007  ad - Implement and use a very simple spinning reader/writer lock.
- Disable preemption where necessary.
 1.22.2.2  05-Dec-2007  yamt lockdebug_mem_check: fix locking.
 1.22.2.1  05-Dec-2007  yamt lockdebug_wantlock: put back cpu_intr_p check which disappeared
during vmlocking -> vmlocking2.
 1.23.4.2  08-Jan-2008  bouyer Sync with HEAD
 1.23.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.28.6.5  17-Jan-2009  mjf Sync with HEAD.
 1.28.6.4  02-Jul-2008  mjf Sync with HEAD.
 1.28.6.3  05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.28.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.28.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.29.2.3  17-Jun-2008  yamt sync with head.
 1.29.2.2  04-Jun-2008  yamt sync with head
 1.29.2.1  18-May-2008  yamt sync with head.
 1.30.2.4  09-Oct-2010  yamt sync with head
 1.30.2.3  11-Mar-2010  yamt sync with head
 1.30.2.2  04-May-2009  yamt sync with head.
 1.30.2.1  16-May-2008  yamt sync with head.
 1.34.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.34.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.2.1  30-Jun-2008  matt Update to HEAD.
 1.37.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.37.2.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.41.4.2  21-Apr-2011  rmind sync with head
 1.41.4.1  05-Mar-2011  rmind sync with head
 1.41.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.43.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.45.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.45.2.1  30-Oct-2012  yamt sync with head
 1.46.2.4  03-Dec-2017  jdolecek update from HEAD
 1.46.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.2.2  23-Jun-2013  tls resync from head
 1.46.2.1  25-Feb-2013  tls resync with head
 1.49.4.1  18-May-2014  rmind sync with head
 1.52.2.4  28-Aug-2017  skrll Sync with HEAD
 1.52.2.3  05-Feb-2017  skrll Sync with HEAD
 1.52.2.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.52.2.1  06-Jun-2015  skrll Sync with HEAD
 1.54.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.54.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.55.4.1  02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.57.2.3  23-Sep-2018  martin Pull up following revision(s) (requested by mrg in ticket #1024):

sys/ddb/db_command.c: revision 1.157
sys/ddb/db_command.c: revision 1.158
sys/kern/subr_lockdebug.c: revision 1.67

always call lockdebug_dismiss() from DDB -- there are always some
minimal lockdebug checks in place, even without LOCKDEBUG.

adjust lockdebug_abort() to ignore problems after ld_panic is set

so that there's a chance of this working.
this fixes ddb 'reboot' on softiron od1000.

call spl0() before cpu_reboot(), so that there's a chance that:
- interrupts can work afterwards
- this also means if IO stalls, serial break might work again.

this mimics how reboot(2) ends up calling cpu_reboot().
 1.57.2.2  07-Sep-2018  martin Pull up following revision(s) (requested by mrg in ticket #1013):

sys/sys/lockdebug.h: revision 1.20
sys/ddb/db_command.c: revision 1.155
sys/kern/subr_lockdebug.c: revision 1.65

add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts. use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.
 1.57.2.1  02-Apr-2018  martin Pull up following revision(s) (requested by ozaki-r in ticket #687):
sys/kern/kern_rwlock_obj.c: revision 1.4
sys/rump/librump/rumpkern/locks.c: revision 1.80
sys/kern/kern_rwlock.c: revision 1.50
sys/arch/x86/x86/db_memrw.c: revision 1.5,1.6
sys/ddb/db_command.c: revision 1.150-1.153
share/man/man4/ddb.4: revision 1.175 (via patch),1.176-1.178
sys/kern/kern_mutex_obj.c: revision 1.6
sys/kern/subr_lockdebug.c: revision 1.61-1.64
sys/sys/lockdebug.h: revision 1.17
sys/kern/kern_mutex.c: revision 1.71
sys/sys/lockdebug.h: revision 1.18,1.19
sys/kern/subr_xcall.c: revision 1.26

Obtain proper initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc

Initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc
were not useful because the addresses were mutex_obj_alloc or rw_obj_alloc
itself. What we want to know are callers of them.

Spinkle ASSERT_SLEEPABLE to xcall functions

Use db_printf instead of printf in ddb

Add a new command, show lockstat, which shows statistics of locks
Currently the command shows the number of allocated locks.
The command is useful only if LOCKDEBUG is enabled.

Add a new command, show all locks, which shows information of active locks

The command shows information of all active (i.e., being held) locks that are
tracked through either of LWPs or CPUs by the LOCKDEBUG facility. The /t
modifier additionally shows a backtrace for each LWP additionally. This
feature is useful for debugging especially to analyze deadlocks.
The command is useful only if LOCKDEBUG is enabled.

Don't pass a unset address to lockdebug_lock_print

x86: avoid accessing invalid addresses in ddb like arm32
This avoids that a command stops in the middle of an execution if
a fault occurs due to an access to an invalid address.

Get rid of a redundant output

Improve wording. Fix a Cm argument.

ddb: rename "show lockstat" to "show lockstats" to avoid conflicting with lockstat(8)
Requested by mrg@
 1.60.2.4  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.60.2.3  30-Sep-2018  pgoyette Ssync with HEAD
 1.60.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.60.2.1  22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.64.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.64.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.64.2.1  10-Jun-2019  christos Sync with HEAD
 1.72.4.2  25-Jan-2020  ad Sync with head.
 1.72.4.1  17-Jan-2020  ad Sync with head.
 1.75.2.1  20-Apr-2020  bouyer Sync with HEAD
 1.77.2.2  03-Apr-2021  thorpej Sync with HEAD.
 1.77.2.1  03-Jan-2021  thorpej Sync w/ HEAD.

RSS XML Feed