From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 23 00:30:22 2015 Return-Path: Delivered-To: freebsd-hackers@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 741F3CCE for ; Fri, 23 Jan 2015 00:30:22 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9992D16 for ; Fri, 23 Jan 2015 00:30:21 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id gf13so541873lab.8 for ; Thu, 22 Jan 2015 16:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1RiJk3nSgI9Lvr/YaHo0yBaSIRG2MwVbZwDpLySTaCs=; b=BG+8JZiJfCIZdiWFnM6/3xd2Xt1SLSb3X3dK9ePiLu0myzem3dJwPcpQCW2+nMLgUJ GBao07qgCHrHj/9t5uMWQ4hSBqvkWz6RBaneTdw4kXVvR3NiNQKTVHXqoISxvaQJfCnj GmssIwU7AGSU98ct0+cgn/ZSDYsBFwIqflPsQoIoWraYdGO5qB2WqksQvVsZuXtwGO7g Fj/4a8GYqYjVG6UIijkSCjAfHWsZ0b4CrsqD09raVWGRmLsRwXDklUx5EfbdvBW7MBiG b1Vd3iFr/nDVpFj2YXP3Sfx7c+rcTp4MsCHPQ4ruuBtRXydQESu5or/rvw7ZT7+embOp 1eBg== MIME-Version: 1.0 X-Received: by 10.112.134.74 with SMTP id pi10mr4586059lbb.67.1421973020025; Thu, 22 Jan 2015 16:30:20 -0800 (PST) Received: by 10.114.78.131 with HTTP; Thu, 22 Jan 2015 16:30:19 -0800 (PST) In-Reply-To: <20150122083514.GU42409@kib.kiev.ua> References: <20150120083212.GC42409@kib.kiev.ua> <20150122083514.GU42409@kib.kiev.ua> Date: Thu, 22 Jan 2015 19:30:19 -0500 Message-ID: Subject: Re: Sleeping thread held mutex in vm_pageout_oom() From: Ryan Stone To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 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 00:30:22 -0000 Other than the redundant braces on the else below, this looks good. I tested it today and saw no further problems. 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. > @@ -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); > + }