From owner-freebsd-arch@freebsd.org Thu Nov 30 20:50:42 2017 Return-Path: Delivered-To: freebsd-arch@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 93973DB9F04 for ; Thu, 30 Nov 2017 20:50:42 +0000 (UTC) (envelope-from lm@mcvoy.com) Received: from mcvoy.com (mcvoy.com [192.169.23.250]) (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 849E574C56; Thu, 30 Nov 2017 20:50:42 +0000 (UTC) (envelope-from lm@mcvoy.com) Received: by mcvoy.com (Postfix, from userid 3546) id A8EBB35E0BB; Thu, 30 Nov 2017 12:50:41 -0800 (PST) Date: Thu, 30 Nov 2017 12:50:41 -0800 From: Larry McVoy To: Mark Johnston Cc: Larry McVoy , Warner Losh , Scott Long , Kevin Bowling , Drew Gallatin , "freebsd-arch@freebsd.org" Subject: Re: small patch for pageout. Comments? Message-ID: <20171130205041.GA3924@mcvoy.com> References: <20171130173424.GA811@mcvoy.com> <20171130184923.GA30262@mcvoy.com> <20171130204750.GB21606@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130204750.GB21606@raichu> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2017 20:50:42 -0000 On Thu, Nov 30, 2017 at 03:47:50PM -0500, Mark Johnston wrote: > > I dunno if there is a "right amount". I could make it a little smarter by > > keeping track of how many pages we freed and sleep if we freed none in a > > scan (which seems really unlikely). > > This situation can happen if the inactive queue is full of dirty pages. > A problem with your patch is that we might not give enough time to the > laundry thread (the thread responsible for writing the contents of dirty > pages to disk and returning them to inactive queue for the page daemon > to free) to write out dirty pages. In this case we might trigger the OOM > killer prematurely, and in fact this scenario is what motivated r300865. > So I would argue that we do in fact need to sleep if the page daemon is > failing to make progress, in order to give time for I/O to complete. OK, that sounds reasonable. So what defines progress? v_dfree not increasing? Is one page freed progress?