From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 8 11:25:56 2013 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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 57789478; Tue, 8 Oct 2013 11:25:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFF032A2A; Tue, 8 Oct 2013 11:25:55 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id x19so5791072qcw.16 for ; Tue, 08 Oct 2013 04:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GTkq7YZP3xrS5a8abx+BYxsqk9e0kg+3EXianFQwyTY=; b=C0bYUk3GX4uR1roZj6IxAQCtNz5xlZnyAbjguIBopr1UsQ14Z7B54dfyt1MHiaQVhe XIgT53Q9ID6c9w1B2cT3kJKPgExKOR9sGYSMst9tXuZTo1t8m+15m+gj9JmOuZ3vnET/ HIYde8haYlyYdtHkp9Pwm/7YbObzMl8Fe9rMsjppKgi4mswgXRj62lesZMNHoaMPAmnz O2eK3SWdQZinHlF7s2txEWVC8fYC2rKhpcV1ZFPiIGbG93SGEciM1EXe/M+/I246l+Mv UC/o5EN4awuluPKpVa1Cbs6yjW3KWSx1mc4jr78gDQdmsgJcekOy0GE/fGjmAJFgTGz5 bBxA== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr2957666qad.76.1381231554854; Tue, 08 Oct 2013 04:25:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Tue, 8 Oct 2013 04:25:54 -0700 (PDT) In-Reply-To: <20131008063433.GA47506@x2.osted.lan> References: <20130828181228.0d3618dd@ernst.home> <201309031507.33098.jhb@freebsd.org> <20131008063433.GA47506@x2.osted.lan> Date: Tue, 8 Oct 2013 04:25:54 -0700 X-Google-Sender-Auth: wahWjwqMNpWYLAzRpvhNwymuofc Message-ID: Subject: Re: Call fo comments - raising vfs.ufs.dirhash_reclaimage? From: Adrian Chadd To: Peter Holm Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Davide Italiano , Kirk McKusick , Alan Cox , freebsd-hackers , freebsd-fs@freebsd.org, Ivan Voras X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2013 11:25:56 -0000 Hi, Please try it out on a -10 VM with something RAM limited - say, 128mb w/ GENERIC. See how it behaves. I've successfully done buildworlds on 10-i386 with 128mb RAM. Let's try not to break that before releng/10 is cut. thanks, -adrian On 7 October 2013 23:34, Peter Holm wrote: > On Mon, Oct 07, 2013 at 07:34:24PM +0200, Davide Italiano wrote: > > > What would perhaps be better than a hardcoded reclaim age would be to > use > > > an LRU-type approach and perhaps set a target percent to reclaim. > That is, > > > suppose you were to reclaim the oldest 10% of hashes on each lowmem > call > > > (and make the '10%' the tunable value). Then you will always make > some amount > > > of progress in a low memory situation (and if the situation remains > dire you > > > will eventually empty the entire cache), but the effective maximum age > will > > > be more dynamic. Right now if you haven't touched UFS in 5 seconds it > > > throws the entire thing out on the first lowmem event. The > LRU-approach would > > > only throw the oldest 10% out on the first call, but eventually throw > it all out > > > if the situation remains dire. > > > > > > -- > > > John Baldwin > > > _______________________________________________ > > > freebsd-fs@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > > > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > > > > I liked your idea more than what's available in HEAD right now and I > > implemented it. > > http://people.freebsd.org/~davide/review/ufs_direclaimage.diff > > I was unsure what kind of heuristic I should choose to select which > > (10% of) entries should be evicted so I just removed the first 10% > > ones from the head of the ufs_dirhash list (which should be the > > oldest). > > The code keeps rescanning the cache until 10% (or, the percentage set > > via SYSCTL) of the entry are freed, but probably we can discuss if > > this limit could be relaxed and just do a single scan over the list. > > Unfortunately I haven't a testcase to prove the effectiveness (or > > non-effectiveness) of the approach but I think either Ivan or Peter > > could be able to give it a spin, maybe. > > > > I gave this patch a spin for 12 hours without finding any problems. > I can do more testing at a later time, if you want to. > > - Peter > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >