From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 3 19:34:44 2014 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 ESMTPS id 2B30460A; Thu, 3 Apr 2014 19:34:44 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF023639; Thu, 3 Apr 2014 19:34:43 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WVnPO-000CJ8-HT; Thu, 03 Apr 2014 19:34:42 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s33JYcKB087556; Thu, 3 Apr 2014 13:34:38 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX193CK3XpM8rnvFLVzzPqWkM Subject: Re: madvise() vs posix_fadvise() From: Ian Lepore To: Dmitry Sivachenko In-Reply-To: <2CB392D0-5198-41EB-8191-8B02FE432334@gmail.com> References: <201404031102.38598.jhb@freebsd.org> <1396539837.81853.278.camel@revolution.hippie.lan> <201404031230.40380.jhb@freebsd.org> <2CB392D0-5198-41EB-8191-8B02FE432334@gmail.com> Content-Type: text/plain; charset="koi8-r" Date: Thu, 03 Apr 2014 13:34:38 -0600 Message-ID: <1396553678.81853.288.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s33JYcKB087556 Cc: freebsd-hackers@FreeBSD.org, Trond =?ISO-8859-1?Q?Endrest=F8l?= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 19:34:44 -0000 On Thu, 2014-04-03 at 23:10 +0400, Dmitry Sivachenko wrote: > On 03 =C1=D0=D2. 2014 =C7., at 20:30, John Baldwin wr= ote: >=20 > >=20 > > The latter. It's sort of like a lazy O_DIRECT. Each time you call w= rite(2), > > it tries to move any clean pages from your current sequentially writt= en > > stream from inactive to cache, so the pages won't move until a subseq= uent > > write(2) after bufdaemon or the syncer actually forces them to be wri= tten. > > Unfortunately, it is currently implemented by doing an internal > > FADV_DONTNEED after each read() or write(). It would be better if it= was > > implemented as a callback when buffers are completed. >=20 >=20 >=20 > Sounds like FADV_NOREUSE should be befeficial for any log-writing progr= am? (syslogd, apache, nginx, .....) I'll probably do something with syslogd soon-ish, it'll help our embedded products at $work that are tight on memory already. -- Ian