aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/racct.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop "All rights reserved" from all my stuff. This includesEdward Tomasz Napierala2020-10-281-1/+0
| | | | | | | | | | | | Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those people, feel free to make similar change. Reviewed by: emaste, imp, gbe (manpages) Differential Revision: https://reviews.freebsd.org/D26980 Notes: svn path=/head/; revision=367105
* racct: add RACCT_ENABLED macro and racct_set_unlockedMateusz Guzik2018-12-071-2/+5
| | | | | | | | | | This allows to remove PROC_LOCK/UNLOCK pairs spread thorought the kernel only used to appease racct_set. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=341701
* Convert racct_enable to bool and annotate as __read_frequentlyMateusz Guzik2018-11-291-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=341182
* Deinline racct throttling out of syscall exit path.Mateusz Guzik2018-11-291-0/+1
| | | | | | | | | | | | racct is not enabled by default and even when it is enabled processes are typically not throttled. The order of checks is left unchanged since racct_enable will be annotated as __read_frequently, while checking for the flag in the processes would probably require an extra fetch. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=341181
* vm: stop taking proc lock in mmap to satisfy racct if it is disabledMateusz Guzik2018-09-181-0/+12
| | | | | | | | | | | | | | | | Limits can be safely obtained with lim_cur from the thread. racct is compiled in but disabled by default. Note that racct enablement is a boot-only tunable. This eliminates second most common place of taking the lock while pkg building. While here don't take the lock in mlockall either. Reviewed by: kib Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17210 Notes: svn path=/head/; revision=338743
* sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326256
* Get rid of rctl_lock; use racct_lock where appropriate. The fast pathsEdward Tomasz Napierala2016-04-211-0/+6
| | | | | | | | | | | | | already required both of them, so having a separate rctl_lock didn't buy us anything. Reviewed by: mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5914 Notes: svn path=/head/; revision=298414
* Make Racct macro slightly more gracious given RACCT_UNDEFINEDConrad Meyer2016-04-201-1/+2
| | | | | | | | | | | | | | rctl_string_to_rule could previously index below the zeroth element of racct_types via the macro. Maybe it shouldn't use the macro on RACCT_UNDEFINED. But given every other RACCT_ definition is non-negative, it seems pretty easy to foot-shoot this one without the check. Reported by: Coverity CID: 1305574 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298333
* Add four new RCTL resources - readbps, readiops, writebps and writeiops,Edward Tomasz Napierala2016-04-071-1/+8
| | | | | | | | | | | | | | | | | | for limiting disk (actually filesystem) IO. Note that in some cases these limits are not quite precise. It's ok, as long as it's within some reasonable bounds. Testing - and review of the code, in particular the VFS and VM parts - is very welcome. MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5080 Notes: svn path=/head/; revision=297633
* Improve comments.Edward Tomasz Napierala2016-03-311-3/+2
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=297460
* Speed up rctl(8) rule retrieval; the difference shows mostly in "rctl -n",Edward Tomasz Napierala2015-11-081-2/+5
| | | | | | | | | | | | as otherwise most of the time is spent resolving UIDs to names. Reviewed by: mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4059 Notes: svn path=/head/; revision=290551
* Add kern.racct.enable tunable and RACCT_DISABLED config option.Edward Tomasz Napierala2015-04-291-0/+4
| | | | | | | | | | | | | | The point of this is to be able to add RACCT (with RACCT_DISABLED) to GENERIC, to avoid having to rebuild the kernel to use rctl(8). Differential Revision: https://reviews.freebsd.org/D2369 Reviewed by: kib@ MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282213
* ifdef RACCT ui_racct_foreach and struct uidinfo's ui_racctMateusz Guzik2014-11-231-9/+2
| | | | | | | | Change racct_ create and destroy to macros evaluating to nothing without RACCT so that their callers passing ui_racct don't have to be ifdefed. Notes: svn path=/head/; revision=274911
* Convert racct stubs to inline functions.Mateusz Guzik2014-10-061-0/+87
| | | | | | | | | This saves some symbols and function calls for kernel without RACCT. MFC after: 1 week Notes: svn path=/head/; revision=272582
* Add CPU percentage limit enforcement to RCTL. The resouce name is "pcpu".Edward Tomasz Napierala2012-10-261-2/+20
| | | | | | | It was implemented by Rudolf Tomori during Google Summer of Code 2012. Notes: svn path=/head/; revision=242139
* Make racct and rctl correctly handle jail renaming. PreviouslyEdward Tomasz Napierala2012-03-061-0/+1
| | | | | | | | | they would continue using old name, the one jail was created with. PR: bin/165207 Notes: svn path=/head/; revision=232598
* Fix another bug introduced in r225641, which caused rctl to access certainEdward Tomasz Napierala2011-10-031-0/+1
| | | | | | | | | fields in 'struct proc' before they got initialized in do_fork(). MFC after: 3 days Notes: svn path=/head/; revision=225940
* Rename resource names to match these in login.conf.Edward Tomasz Napierala2011-07-141-3/+3
| | | | Notes: svn path=/head/; revision=224036
* Style fix - macros are supposed to be uppercase.Edward Tomasz Napierala2011-07-071-5/+5
| | | | Notes: svn path=/head/; revision=223844
* Remove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are ratherEdward Tomasz Napierala2011-05-271-21/+19
| | | | | | | | performance-sensitive and not that useful, so I won't be merging them before 9.0. Notes: svn path=/head/; revision=222380
* Add racct. It's an API to keep per-process, per-jail, per-loginclassEdward Tomasz Napierala2011-03-291-0/+147
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) Notes: svn path=/head/; revision=220137