Date: Fri, 27 Dec 2019 13:37:20 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356122 - head/sys/kern Message-ID: <201912271337.xBRDbKRS090780@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Fri Dec 27 13:37:19 2019 New Revision: 356122 URL: https://svnweb.freebsd.org/changeset/base/356122 Log: Plug a warning in read-mostly spinlocks reported by gcc. Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Dec 27 11:26:12 2019 (r356121) +++ head/sys/kern/kern_rmlock.c Fri Dec 27 13:37:19 2019 (r356122) @@ -1064,7 +1064,8 @@ rms_wlock(struct rmslock *rms) mtx_lock(&rms->mtx); rms->writers++; if (rms->writers > 1) { - msleep(&rms->writers, &rms->mtx, PUSER - 1 | PDROP, mtx_name(&rms->mtx), 0); + msleep(&rms->writers, &rms->mtx, (PUSER - 1) | PDROP, + mtx_name(&rms->mtx), 0); MPASS(rms->readers == 0); return; } @@ -1072,7 +1073,8 @@ rms_wlock(struct rmslock *rms) rms_wlock_switch(rms); if (rms->readers > 0) - msleep(&rms->writers, &rms->mtx, PUSER - 1 | PDROP, mtx_name(&rms->mtx), 0); + msleep(&rms->writers, &rms->mtx, (PUSER - 1) | PDROP, + mtx_name(&rms->mtx), 0); else mtx_unlock(&rms->mtx); MPASS(rms->readers == 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912271337.xBRDbKRS090780>