Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2012 13:54:18 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Tim LaBerge <tlaberge@juniper.net>, Alan Cox <alc@rice.edu>, "freebsd-arch@freebsd.org Arch" <freebsd-arch@freebsd.org>
Subject:   Re: Behavior of madvise(MADV_FREE)
Message-ID:  <E6A52D27-0D6A-4175-9ECA-ADE25BFF35C2@xcllnt.net>
In-Reply-To: <4835.1350062021@critter.freebsd.dk>
References:  <9FEBC10C-C453-41BE-8829-34E830585E90@xcllnt.net> <4835.1350062021@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Oct 12, 2012, at 10:13 AM, Poul-Henning Kamp <phk@phk.freebsd.dk> 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E6A52D27-0D6A-4175-9ECA-ADE25BFF35C2>