locks: remove SCHEDULER_STOPPED checks from primitives for modules

They all fallback to the slow path if necessary and the check is there.

This means a panicked kernel executing code from modules will be able to
succeed doing actual lock/unlock, but this was already the case for core code
which has said primitives inlined.
This commit is contained in:
Mateusz Guzik 2017-02-17 05:09:51 +00:00
parent 4c9ea0ced9
commit afa39f7a32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313853
3 changed files with 0 additions and 16 deletions

View File

@ -231,9 +231,6 @@ __mtx_lock_flags(volatile uintptr_t *c, int opts, const char *file, int line)
struct mtx *m;
uintptr_t tid, v;
if (SCHEDULER_STOPPED())
return;
m = mtxlock2mtx(c);
KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
@ -266,9 +263,6 @@ __mtx_unlock_flags(volatile uintptr_t *c, int opts, const char *file, int line)
{
struct mtx *m;
if (SCHEDULER_STOPPED())
return;
m = mtxlock2mtx(c);
KASSERT(m->mtx_lock != MTX_DESTROYED,

View File

@ -267,9 +267,6 @@ _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line)
struct rwlock *rw;
uintptr_t tid, v;
if (SCHEDULER_STOPPED())
return;
rw = rwlock2rw(c);
KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
@ -335,9 +332,6 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line)
{
struct rwlock *rw;
if (SCHEDULER_STOPPED())
return;
rw = rwlock2rw(c);
KASSERT(rw->rw_lock != RW_DESTROYED,

View File

@ -295,8 +295,6 @@ _sx_xlock(struct sx *sx, int opts, const char *file, int line)
uintptr_t tid, x;
int error = 0;
if (SCHEDULER_STOPPED())
return (0);
KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
("sx_xlock() by idle thread %p on sx %s @ %s:%d",
curthread, sx->lock_object.lo_name, file, line));
@ -360,8 +358,6 @@ void
_sx_xunlock(struct sx *sx, const char *file, int line)
{
if (SCHEDULER_STOPPED())
return;
KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
("sx_xunlock() of destroyed sx @ %s:%d", file, line));
_sx_assert(sx, SA_XLOCKED, file, line);