summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_racct.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve KASSERT messages in racct, to make it clear which resourcetrasz2012-11-151-12/+17
| | | | | | caused the problem. Submitted by: mjg
* Fix kassert that's not really valid for %CPU accounting. The problemtrasz2012-11-151-2/+3
| | | | | | | | 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
* Don't divide by zero.trasz2012-11-131-6/+12
| | | | Tested by: swills
* Add CPU percentage limit enforcement to RCTL. The resouce name is "pcpu".trasz2012-10-261-29/+468
| | | | It was implemented by Rudolf Tomori during Google Summer of Code 2012.
* Fix panic with RACCT that could occur in low memory (or out of swap)trasz2012-05-221-0/+3
| | | | | | | | 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>
* Stop treating system processes as special. This fixes panicstrasz2012-04-171-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation.jh2012-03-181-1/+2
| | | | | | | PR: kern/161552 Reviewed by: trasz Tested by: Nikos Vassiliadis MFC after: 1 week
* Remove useless thread_{lock,unlock}() in raccd.trasz2012-03-101-4/+1
|
* Make racct and rctl correctly handle jail renaming. Previouslytrasz2012-03-061-0/+12
| | | | | | they would continue using old name, the one jail was created with. PR: bin/165207
* kern_racct: move sys/systm.h inclusion to its proper placeavg2011-12-121-2/+1
| | | | | | | | This should fix the build failure introduced with r228424. Also remove duplicate inclusion of sys/param.h. Pointyhat to: avg MFC after: 1 week
* Actually enforce limit for inheritable resources on fork.trasz2011-10-041-6/+6
| | | | MFC after: 3 days
* Move some code inside the racct_proc_fork(); it spares a few lock operationstrasz2011-10-031-9/+22
| | | | | | and it's more logical this way. MFC after: 3 days
* Fix another bug introduced in r225641, which caused rctl to access certaintrasz2011-10-031-0/+23
| | | | | | fields in 'struct proc' before they got initialized in do_fork(). MFC after: 3 days
* Fix bug introduced in r225641, which would cause panic if racct_proc_fork()trasz2011-10-031-18/+1
| | | | | | returned error -- the racct_destroy_locked() would get called twice. MFC after: 3 days
* Fix panic that happens when fork(2) fails due to a limit other thantrasz2011-09-031-7/+12
| | | | | | | the rctl one - for example, it happens when someone reaches maximum number of processes in the system. Approved by: re (kib)
* Rename resource names to match these in login.conf.trasz2011-07-141-2/+2
|
* Style fix - macros are supposed to be uppercase.trasz2011-07-071-12/+12
|
* Remove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are rathertrasz2011-05-271-5/+0
| | | | | performance-sensitive and not that useful, so I won't be merging them before 9.0.
* Change the way rctl interfaces with jails by introducing prison_raccttrasz2011-05-031-5/+9
| | | | | | 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.
* Add missing stubs.trasz2011-04-051-0/+12
|
* Remove pointless (always true) KASSERTs.trasz2011-03-291-19/+0
| | | | Submitted by: pjd
* Add racct. It's an API to keep per-process, per-jail, per-loginclasstrasz2011-03-291-0/+837
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)
OpenPOWER on IntegriCloud