mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri
In case of some consumers like zfs there are no waiters vast majority of the time Reviewed by: jhb MFC after: 1 week
This commit is contained in:
parent
949b56ba66
commit
5b7d9ae2fd
1 changed files with 4 additions and 0 deletions
|
|
@ -397,6 +397,8 @@ cv_signal(struct cv *cvp)
|
|||
{
|
||||
int wakeup_swapper;
|
||||
|
||||
if (cvp->cv_waiters == 0)
|
||||
return;
|
||||
wakeup_swapper = 0;
|
||||
sleepq_lock(cvp);
|
||||
if (cvp->cv_waiters > 0) {
|
||||
|
|
@ -424,6 +426,8 @@ cv_broadcastpri(struct cv *cvp, int pri)
|
|||
{
|
||||
int wakeup_swapper;
|
||||
|
||||
if (cvp->cv_waiters == 0)
|
||||
return;
|
||||
/*
|
||||
* XXX sleepq_broadcast pri argument changed from -1 meaning
|
||||
* no pri to 0 meaning no pri.
|
||||
|
|
|
|||
Loading…
Reference in a new issue