From owner-svn-src-head@freebsd.org Fri Feb 17 05:09:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BBDCCDF6DF; Fri, 17 Feb 2017 05:09:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23ED21BDC; Fri, 17 Feb 2017 05:09:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H59qnO019804; Fri, 17 Feb 2017 05:09:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H59qJA019801; Fri, 17 Feb 2017 05:09:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702170509.v1H59qJA019801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 05:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313853 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 05:09:53 -0000 Author: mjg Date: Fri Feb 17 05:09:51 2017 New Revision: 313853 URL: https://svnweb.freebsd.org/changeset/base/313853 Log: 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. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_mutex.c Fri Feb 17 05:09:51 2017 (r313853) @@ -231,9 +231,6 @@ __mtx_lock_flags(volatile uintptr_t *c, 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 { struct mtx *m; - if (SCHEDULER_STOPPED()) - return; - m = mtxlock2mtx(c); KASSERT(m->mtx_lock != MTX_DESTROYED, Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_rwlock.c Fri Feb 17 05:09:51 2017 (r313853) @@ -267,9 +267,6 @@ _rw_wlock_cookie(volatile uintptr_t *c, 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 { struct rwlock *rw; - if (SCHEDULER_STOPPED()) - return; - rw = rwlock2rw(c); KASSERT(rw->rw_lock != RW_DESTROYED, Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_sx.c Fri Feb 17 05:09:51 2017 (r313853) @@ -295,8 +295,6 @@ _sx_xlock(struct sx *sx, int opts, const 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);