From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 4 21:02:14 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 886132DC; Fri, 4 Apr 2014 21:02:14 +0000 (UTC) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D608A13D; Fri, 4 Apr 2014 21:02:13 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id q8so2942440lbi.0 for ; Fri, 04 Apr 2014 14:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Yv5a34cM3GBmF2frrUEbEmZd0GmzEdhCsLgviVVElkU=; b=ATZqYtBvPD9N3wxin/nsHNFYnTIuTgCO4W0D3rvgWTuZiPnZCWZrMi6RedOPOYokg4 hBRB7E3TJkPM4bVQoPB2EL9v30DD+2mcfPP5o2HNCrwXmKsNuvT40YUt2pAju+Ru6H4k Ke8voH0h0HcRyPoNdY0New8JGx358HE2aq6TpZy6OvcDgRL1xqIeXd1ZwArsDdxslxsS mAWel5ILwgs8VPA+pKocQH8tUjlsnpefYbugBQuH79JviZXOpJF1irtp5RVXXvKBA+4S HHMoXCa1mp2ebKdOCWAvVQ2adejz+S6cW/nzp+rTvMHxQ6SvxJb92clzzHTb5hdfvopM GtyQ== X-Received: by 10.112.171.1 with SMTP id aq1mr111593lbc.67.1396645331895; Fri, 04 Apr 2014 14:02:11 -0700 (PDT) Received: from [10.0.1.9] (ip-95-220-108-153.bb.netbynet.ru. [95.220.108.153]) by mx.google.com with ESMTPSA id mk5sm8860930lac.6.2014.04.04.14.02.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 14:02:11 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: madvise() vs posix_fadvise() From: Dmitry Sivachenko In-Reply-To: <201404041612.35889.jhb@freebsd.org> Date: Sat, 5 Apr 2014 01:02:08 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: <5426E303-E35B-4D4A-AB62-3571228A5A2C@gmail.com> References: <201404031102.38598.jhb@freebsd.org> <201404041612.35889.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1874) Cc: freebsd-hackers@freebsd.org, =?utf-8?Q?Trond_Endrest=C3=B8l?= 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: Fri, 04 Apr 2014 21:02:14 -0000 On 05 =D0=B0=D0=BF=D1=80. 2014 =D0=B3., at 0:12, John Baldwin = wrote: >=20 > MADV_WILLNEED is not going to give you what you want. OTOH, if you = haven't > tried FreeBSD 10 yet, I would suggest trying that. There have been = changes > to pagedaemon that might make it do a better job of kicking out the = pages > of the log files automatically. >=20 I did. My situation became worse after I moved from stable/9 to = stable/10. My feeling is that stable/10 pushes rarely used mmaped pages out of RAM = more aggressively than stable/9 did. For now, the only solution I found is doing msync(MS_INVALIDATE) on log = files after gzipping and after backup via rsync. This moves corresponding memory pages from Inactive to Free and prevents = system to occupy all free memory with cached log files and to purge = mmaped data out of RAM to accomodate more disk cache. What I would love to see is an ability to tell OS not to release mmaped = data unless "really needed" (disk cache is not an excuse).=