racct: perform a lockless check for p_throttled

This reduces proc lock contention.

Reviewed by:	trasz
This commit is contained in:
Mateusz Guzik 2015-07-13 22:52:11 +00:00
parent d4f3ad3a26
commit e94e50af1d

View File

@ -172,7 +172,7 @@ userret(struct thread *td, struct trapframe *frame)
(td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
#endif
#ifdef RACCT
if (racct_enable) {
if (racct_enable && p->p_throttled == 1) {
PROC_LOCK(p);
while (p->p_throttled == 1)
msleep(p->p_racct, &p->p_mtx, 0, "racct", 0);