From owner-svn-src-head@freebsd.org Sun Nov 12 03:13:02 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 9D7C7E66ACC; Sun, 12 Nov 2017 03:13:02 +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 68ECC79D0C; Sun, 12 Nov 2017 03:13:02 +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 vAC3D124074274; Sun, 12 Nov 2017 03:13:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAC3D1o4074273; Sun, 12 Nov 2017 03:13:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711120313.vAC3D1o4074273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 Nov 2017 03:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325734 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 325734 X-SVN-Commit-Repository: base 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.25 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: Sun, 12 Nov 2017 03:13:02 -0000 Author: mjg Date: Sun Nov 12 03:13:01 2017 New Revision: 325734 URL: https://svnweb.freebsd.org/changeset/base/325734 Log: amd64: stop nesting preemption counter in spinlock_enter Discussed with: jhb Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Nov 12 02:34:33 2017 (r325733) +++ head/sys/amd64/amd64/machdep.c Sun Nov 12 03:13:01 2017 (r325734) @@ -1853,9 +1853,9 @@ spinlock_enter(void) flags = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = flags; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -1865,11 +1865,12 @@ spinlock_exit(void) register_t flags; td = curthread; - critical_exit(); flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(flags); + } } /*