From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 23 08:37:01 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EEFE28F for ; Fri, 23 Jan 2015 08:37:01 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 727A5FC5 for ; Fri, 23 Jan 2015 08:37:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t0N8asnd091987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Jan 2015 10:36:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t0N8asnd091987 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t0N8asKp091986; Fri, 23 Jan 2015 10:36:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Jan 2015 10:36:54 +0200 From: Konstantin Belousov To: Ryan Stone Subject: Re: Sleeping thread held mutex in vm_pageout_oom() Message-ID: <20150123083654.GB42409@kib.kiev.ua> References: <20150120083212.GC42409@kib.kiev.ua> <20150122083514.GU42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 08:37:01 -0000 On Thu, Jan 22, 2015 at 07:30:19PM -0500, Ryan Stone wrote: > Other than the redundant braces on the else below, this looks good. I > tested it today and saw no further problems. The (possibly implicit) style rule is to have {} around both branches in if () when one branch requires {}. > > I do think that a WITNESS_WARN() in vmspace_free() would be > appropriate. I'll give that a sanity here to make sure that nothing > explodes and if everything looks ok, I'll commit it. Ok. > > > @@ -1573,16 +1602,19 @@ vm_pageout_oom(int shortage) > > */ > > if (size > bigsize) { > > if (bigproc != NULL) > > - PROC_UNLOCK(bigproc); > > + PRELE(bigproc); > > bigproc = p; > > bigsize = size; > > - } else > > - PROC_UNLOCK(p); > > + } else { > > + PRELE(p); > > + }