From owner-svn-src-all@freebsd.org Wed Jun 24 15:52:27 2015 Return-Path: Delivered-To: svn-src-all@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 926D491609C; Wed, 24 Jun 2015 15:52:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 83C3A2666; Wed, 24 Jun 2015 15:52:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5OFqReM023688; Wed, 24 Jun 2015 15:52:27 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5OFqREr023687; Wed, 24 Jun 2015 15:52:27 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201506241552.t5OFqREr023687@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 24 Jun 2015 15:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284766 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2015 15:52:27 -0000 Author: sbruno Date: Wed Jun 24 15:52:26 2015 New Revision: 284766 URL: https://svnweb.freebsd.org/changeset/base/284766 Log: At the suggestion of jhb, replace atomic_set/clear calls with use of exclusive locks in the enable/disable interpreter path. Tested with WITNESS/INVARIANTS on and off. Reviewed by: sson davide Modified: head/sys/kern/imgact_binmisc.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Wed Jun 24 15:13:27 2015 (r284765) +++ head/sys/kern/imgact_binmisc.c Wed Jun 24 15:52:26 2015 (r284766) @@ -308,14 +308,14 @@ imgact_binmisc_disable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_slock(&interp_list_sx); + sx_xlock(&interp_list_sx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_sunlock(&interp_list_sx); + sx_xunlock(&interp_list_sx); return (ENOENT); } - atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); - sx_sunlock(&interp_list_sx); + ibe->ibe_flags &= ~IBF_ENABLED; + sx_xunlock(&interp_list_sx); return (0); } @@ -329,14 +329,14 @@ imgact_binmisc_enable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_slock(&interp_list_sx); + sx_xlock(&interp_list_sx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_sunlock(&interp_list_sx); + sx_xunlock(&interp_list_sx); return (ENOENT); } - atomic_set_32(&ibe->ibe_flags, IBF_ENABLED); - sx_sunlock(&interp_list_sx); + ibe->ibe_flags |= IBF_ENABLED; + sx_xunlock(&interp_list_sx); return (0); }