Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/subr_lwp_specificdata.c
RevisionDateAuthorComments
 1.5  01-Sep-2024  andvar s/specifc/specific/ in comments.
 1.4  17-May-2019  ozaki-r branches: 1.4.34;
Implement an aggressive psref leak detector

It is yet another psref leak detector that enables to tell where a leak occurs
while a simpler version that is already committed just tells an occurrence of a
leak.

Investigating of psref leaks is hard because once a leak occurs a percpu list of
psref that tracks references can be corrupted. A reference to a tracking object
is memorized in the list via an intermediate object (struct psref) that is
normally allocated on a stack of a thread. Thus, the intermediate object can be
overwritten on a leak resulting in corruption of the list.

The tracker makes a shadow entry to an intermediate object and stores some hints
into it (currently it's a caller address of psref_acquire). We can detect a
leak by checking the entries on certain points where any references should be
released such as the return point of syscalls and the end of each softint
handler.

The feature is expensive and enabled only if the kernel is built with
PSREF_DEBUG.

Proposed on tech-kern
 1.3  25-Oct-2013  martin branches: 1.3.30;
Mark a diagnostic-only variable
 1.2  12-Apr-2010  christos branches: 1.2.2; 1.2.4; 1.2.6; 1.2.14; 1.2.24; 1.2.28;
void police!
 1.1  12-Apr-2010  pooka Separate lwp specificdata data structure management from lwp cpu/vm
management.

No functional change.

(specificdata routines went from kern_lwp.c to subr_lwp_specificdata.c)
 1.2.28.1  18-May-2014  rmind sync with head
 1.2.24.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.14.1  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.2.6.2  11-Aug-2010  yamt sync with head.
 1.2.6.1  12-Apr-2010  yamt file subr_lwp_specificdata.c was added on branch yamt-nfs-mp on 2010-08-11 22:54:42 +0000
 1.2.4.2  30-May-2010  rmind sync with head
 1.2.4.1  12-Apr-2010  rmind file subr_lwp_specificdata.c was added on branch rmind-uvmplock on 2010-05-30 05:17:58 +0000
 1.2.2.2  30-Apr-2010  uebayasi Sync with HEAD.
 1.2.2.1  12-Apr-2010  uebayasi file subr_lwp_specificdata.c was added on branch uebayasi-xip on 2010-04-30 14:44:12 +0000
 1.3.30.1  10-Jun-2019  christos Sync with HEAD
 1.4.34.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed