diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2018-11-29 05:08:46 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2018-11-29 05:08:46 +0000 |
commit | 64cf6a62d419ba4df40ebb12c0dd9130128e0724 (patch) | |
tree | 76eb199cecc19e24c63240fe68ab7e0b5f6652e4 /sys/kern/subr_trap.c | |
parent | e272bf479b763fbe9bfe72877ccf8889434d4e87 (diff) | |
download | src-64cf6a62d419ba4df40ebb12c0dd9130128e0724.tar.gz src-64cf6a62d419ba4df40ebb12c0dd9130128e0724.zip |
Deinline racct throttling out of syscall exit path.
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
Notes:
svn path=/head/; revision=341181
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 72a0b8f8d481..2dee196f2a02 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -198,16 +198,8 @@ userret(struct thread *td, struct trapframe *frame) (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); #endif #ifdef RACCT - if (racct_enable && p->p_throttled != 0) { - PROC_LOCK(p); - while (p->p_throttled != 0) { - msleep(p->p_racct, &p->p_mtx, 0, "racct", - p->p_throttled < 0 ? 0 : p->p_throttled); - if (p->p_throttled > 0) - p->p_throttled = 0; - } - PROC_UNLOCK(p); - } + if (__predict_false(racct_enable && p->p_throttled != 0)) + racct_proc_throttled(p); #endif } |