From owner-svn-src-head@freebsd.org Mon Dec 25 17:49:57 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 63AA6E9BA3D; Mon, 25 Dec 2017 17:49:57 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 391456C70D; Mon, 25 Dec 2017 17:49:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id A0DA0D0035C; Mon, 25 Dec 2017 12:49:48 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id vBPHnkt9010027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Dec 2017 18:49:46 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id vBPHnk5H010026; Mon, 25 Dec 2017 18:49:46 +0100 (CET) (envelope-from pho) Date: Mon, 25 Dec 2017 18:49:46 +0100 From: Peter Holm To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327168 - head/sys/vm Message-ID: <20171225174946.GA9941@x2.osted.lan> References: <201712241945.vBOJjGV5051696@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712241945.vBOJjGV5051696@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Mon, 25 Dec 2017 17:49:57 -0000 On Sun, Dec 24, 2017 at 07:45:16PM +0000, Mark Johnston wrote: > Author: markj > Date: Sun Dec 24 19:45:16 2017 > New Revision: 327168 > URL: https://svnweb.freebsd.org/changeset/base/327168 > > Log: > Fix two problems with the page daemon control loop. > > Both issues caused the page daemon to erroneously go to sleep when > applications are consuming free pages at a high rate, leaving the > application threads blocked in VM_WAIT. > > 1) After completing an inactive queue scan, concurrent allocations may > have prevented the page daemon from meeting the v_free_min threshold. > In this case, the page daemon was going to sleep even when the > inactive queue contained plenty of clean pages. > 2) pagedaemon_wakeup() may be called without the free queues lock held. > This can lead to a lost wakeup if a call occurs after the page daemon > clears vm_pageout_wanted but before going to sleep. > > Fix 1) by ensuring that we start a new inactive queue scan immediately > if v_free_count < v_free_min after a prior scan. > > Fix 2) by adding a new subroutine, pagedaemon_wait(), called from > vm_wait() and vm_waitpfault(). It wakes up the page daemon if either > vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps > on v_free_count. > > Reported by: jeff > Reviewed by: alc > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D13424 > > Modified: > head/sys/vm/vm_page.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pageout.h > I now see threads blocked in VM_WAIT? https://people.freebsd.org/~pho/stress/log/mark013.txt - Peter