From owner-svn-src-head@FreeBSD.ORG Sat Jun 20 04:10:19 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4061B759; Sat, 20 Jun 2015 04:10:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB002C28; Sat, 20 Jun 2015 04:10:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t5K4ACDl061618 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 20 Jun 2015 07:10:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t5K4ACDl061618 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t5K4AC0R061616; Sat, 20 Jun 2015 07:10:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Jun 2015 07:10:12 +0300 From: Konstantin Belousov To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284602 - head/sys/kern Message-ID: <20150620041012.GQ2080@kib.kiev.ua> References: <201506191857.t5JIvbdP094203@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201506191857.t5JIvbdP094203@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 20 Jun 2015 04:10:19 -0000 On Fri, Jun 19, 2015 at 06:57:37PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Jun 19 18:57:36 2015 > New Revision: 284602 > URL: https://svnweb.freebsd.org/changeset/base/284602 > > Log: > Feedback from commit r284535 > > davide: imgact_binmisc_clear_entry() needs to use atomic ops to remove > the enable bit. > > kib: M_NOWAIT is not warranted and comment is invalid. > > Modified: > head/sys/kern/imgact_binmisc.c > > Modified: head/sys/kern/imgact_binmisc.c > ============================================================================== > --- head/sys/kern/imgact_binmisc.c Fri Jun 19 17:34:59 2015 (r284601) > +++ head/sys/kern/imgact_binmisc.c Fri Jun 19 18:57:36 2015 (r284602) > @@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name) > return (ENOENT); > } > > - ibe->ibe_flags &= ~IBF_ENABLED; > + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); > sx_sunlock(&interp_list_sx); > > return (0); > @@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sy > > sx_slock(&interp_list_sx); > count = interp_list_entry_count; > - /* Don't block in malloc() while holding lock. */ > - xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); > + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO); Was the change tested at all ? Malloc(9) requires either M_WAITOK or M_NOWAIT flags to be present. > if (!xbe) { > sx_sunlock(&interp_list_sx); > return (ENOMEM); As I noted in my mail, xbe == NULL is impossible with M_WAITOK.