From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 24 23:31:51 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A04F1065675 for ; Sat, 24 Jul 2010 23:31:51 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id F401C8FC1D for ; Sat, 24 Jul 2010 23:31:50 +0000 (UTC) Received: by wwf26 with SMTP id 26so1830920wwf.1 for ; Sat, 24 Jul 2010 16:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=c/Zz3jJxC6Em1dcecFq5UHhBvR6yJtQ6bvacf/+T+Tg=; b=uqXWuT5I4zb+2m8AqkQQKcuEv3NWNtpkxwQ4cuZYD8NwZxZWQpzJCnHVM+q9c/mFvK 8aSVUg/XbQayLUC23IK67+5haxPc4tzS7Ngbd1VwRZZ75M9CAytlxyU17FnBohJ4MwTM KRdImLIX3SdKZJ0Yp8DqhSZYEt7kooCcJuX7c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=bbY+6hgMkc+q1XkfTs/6tXuCiIfsnW1a7mWtTvpCfcDVwtZlU218A6yHAMMO/2siJG uqwgLaTruJ1KihS+4v4ToD9XlmMUzZHgOCCkmZsmMwyniXgQZdueQhEdwMfkLDnSXegt EBAU6DEhc0sPEuQXHhj567Fgry8ETmZYyv68c= Received: by 10.227.148.2 with SMTP id n2mr5297342wbv.216.1280014309884; Sat, 24 Jul 2010 16:31:49 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id i25sm1566575wbi.10.2010.07.24.16.31.46 (version=SSLv3 cipher=RC4-MD5); Sat, 24 Jul 2010 16:31:46 -0700 (PDT) Date: Sun, 25 Jul 2010 00:31:44 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20100725003144.3cfead39@gumby.homeunix.com> In-Reply-To: <4C4B4BAB.3000005@freebsd.org> References: <4C4B4BAB.3000005@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: pageout question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2010 23:31:51 -0000 On Sat, 24 Jul 2010 23:23:07 +0300 Andriy Gapon wrote: > > There is a good deal of comments in the vm_pageout.c code that imply > that we use a hysteresis approach to deal with low available pages > condition. > > > In general, the hysteresis, the comments and the code make sense. > My doubt, though, is about the block of code that is right below the > comment quoted above: > if (vm_pages_needed && !vm_page_count_min()) { > if (!vm_paging_needed()) > vm_pages_needed = 0; > wakeup(&cnt.v_free_count); > } As I understand it the hysteresis is done inside vm_pageout_scan, and the expectation is that one pass will typically satisfy this because the design aims to keep enough clean pages in the inactive queue. I'm not sure if the vm_paging_needed() call is correct or not, but it may be that that the intent is to avoid immediately going back to a depleted inactive queue when cache+free is within normal bounds, because it could result in avoidable paging to swap.