From owner-freebsd-arch@FreeBSD.ORG Fri Oct 12 20:54:27 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2F31D27 for ; Fri, 12 Oct 2012 20:54:27 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id AADF88FC18 for ; Fri, 12 Oct 2012 20:54:27 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q9CKsNfJ068081 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 12 Oct 2012 13:54:25 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Behavior of madvise(MADV_FREE) From: Marcel Moolenaar In-Reply-To: <4835.1350062021@critter.freebsd.dk> Date: Fri, 12 Oct 2012 13:54:18 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <9FEBC10C-C453-41BE-8829-34E830585E90@xcllnt.net> <4835.1350062021@critter.freebsd.dk> To: Poul-Henning Kamp X-Mailer: Apple Mail (2.1499) Cc: Tim LaBerge , Alan Cox , "freebsd-arch@freebsd.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 20:54:27 -0000 On Oct 12, 2012, at 10:13 AM, Poul-Henning Kamp wrote: >> Now on to the questions: >> 1. madvise(MADV_FREE) marks the pages as clean and moves >> them to the inactive queue. > The mapping were left alone, because it was estimated and measured > that there were a high frequency of mapping reuse, in particular > in the WorldStone where multiple passes of GCC competed for physical > memory. The reference bit were left alone to not disturb the > perceived/ measured VM-footprint of the process. Good info. Thanks. > Given that paging anonymous pages to disk is not a major activity > and unlikely to ever become a performance bottleneck again, it may > make good sense to let MADV_FREE make the pages more appetizing > for the rest of the system. > > But all things considered, I would advocate implementing MADV_RECYCLE > for that, we need more nuance and expressability in madvice(2) and > MADV_RECYCLE would be a good addition in its own right. Ok. I think Linux has MADV_REMOVE that roughly matches the semantics, so it's not "non-standard" to add more behaviours. BTW: MADV_DONTNEED in Linux seems to behave like MADV_FREE in FreeBSD -- at least according to the manpage. Which makes me wonder how standard madvise(2) is anyway. -- Marcel Moolenaar marcel@xcllnt.net