History log of /freebsd-10.1-release/sys/kern/kern_racct.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 260817 17-Jan-2014 avg

MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 248298 14-Mar-2013 trasz

Accessing td_state requires thread lock to be held.

Submitted by: Rudo Tomori
Reviewed by: kib


# 243088 15-Nov-2012 trasz

Improve KASSERT messages in racct, to make it clear which resource
caused the problem.

Submitted by: mjg


# 243070 15-Nov-2012 trasz

Fix kassert that's not really valid for %CPU accounting. The problem
here is race between decaying the resource usage in containers, and updating
per-process usage; basically, the former may cause per-container usage
to get smaller than per-process usage.

Submitted by: Rudo Tomori


# 242957 13-Nov-2012 trasz

Don't divide by zero.

Tested by: swills


# 242139 26-Oct-2012 trasz

Add CPU percentage limit enforcement to RCTL. The resouce name is "pcpu".
It was implemented by Rudolf Tomori during Google Summer of Code 2012.


# 235787 22-May-2012 trasz

Fix panic with RACCT that could occur in low memory (or out of swap)
situations, due to fork1() calling racct_proc_exit() without calling
racct_proc_fork() first.

Submitted by: Mateusz Guzik <mjguzik at gmail dot com> (earlier version)
Reviewed by: Mateusz Guzik <mjguzik at gmail dot com>


# 234383 17-Apr-2012 trasz

Stop treating system processes as special. This fixes panics
like the one triggered by this:

# kldload geom_vinum
# pwait `pgrep -S gv_worker` &
# kldunload geom_vinum

or this:

GEOM_JOURNAL: Shutting down geom gjournal 3464572051.
panic: destroying non-empty racct: 1 allocated for resource 6

which were tracked by jh@ to be caused by checking p->p_flag,
while it wasn't initialised yet. Basically, during fork, the code
checked p_flag, concluded the process isn't marked as P_SYSTEM,
incremented the counter, and later on, when exiting, checked that
the process was marked as P_SYSTEM, and thus didn't decrement it.

Also, I believe there wasn't any good reason for checking P_SYSTEM
in the first place.

Tested by: jh


# 233126 18-Mar-2012 jh

Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation.

PR: kern/161552
Reviewed by: trasz
Tested by: Nikos Vassiliadis
MFC after: 1 week


# 232782 10-Mar-2012 trasz

Remove useless thread_{lock,unlock}() in raccd.


# 232598 06-Mar-2012 trasz

Make racct and rctl correctly handle jail renaming. Previously
they would continue using old name, the one jail was created with.

PR: bin/165207


# 228430 12-Dec-2011 avg

kern_racct: move sys/systm.h inclusion to its proper place

This should fix the build failure introduced with r228424.
Also remove duplicate inclusion of sys/param.h.

Pointyhat to: avg
MFC after: 1 week


# 225981 04-Oct-2011 trasz

Actually enforce limit for inheritable resources on fork.

MFC after: 3 days


# 225944 03-Oct-2011 trasz

Move some code inside the racct_proc_fork(); it spares a few lock operations
and it's more logical this way.

MFC after: 3 days


# 225940 03-Oct-2011 trasz

Fix another bug introduced in r225641, which caused rctl to access certain
fields in 'struct proc' before they got initialized in do_fork().

MFC after: 3 days


# 225938 03-Oct-2011 trasz

Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice.

MFC after: 3 days


# 225364 03-Sep-2011 trasz

Fix panic that happens when fork(2) fails due to a limit other than
the rctl one - for example, it happens when someone reaches maximum
number of processes in the system.

Approved by: re (kib)


# 224036 14-Jul-2011 trasz

Rename resource names to match these in login.conf.


# 223844 07-Jul-2011 trasz

Style fix - macros are supposed to be uppercase.


# 222380 27-May-2011 trasz

Remove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are rather
performance-sensitive and not that useful, so I won't be merging them
before 9.0.


# 221362 03-May-2011 trasz

Change the way rctl interfaces with jails by introducing prison_racct
structure, which acts as a proxy between them. This makes jail rules
persistent, i.e. they can be added before jail gets created, and they
don't disappear when the jail gets destroyed.


# 220372 05-Apr-2011 trasz

Add missing stubs.


# 220146 29-Mar-2011 trasz

Remove pointless (always true) KASSERTs.

Submitted by: pjd


# 220137 29-Mar-2011 trasz

Add racct. It's an API to keep per-process, per-jail, per-loginclass
and per-loginclass resource accounting information, to be used by the new
resource limits code. It's connected to the build, but the code that
actually calls the new functions will come later.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)