Date: Tue, 13 Jul 2021 19:03:16 +0800 From: Ka Ho Ng <khng300@gmail.com> To: Vitaliy Gusev <gusev.vitaliy@gmail.com> Cc: freebsd-hackers@freebsd.org, gljennjohn@gmail.com, Mark Johnston <markj@freebsd.org>, Peter Grehan <grehan@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com> Subject: Re: madvise(MADV_FREE) doesn't work in some cases? Message-ID: <4cab2b26-e9cb-6ca7-fbd1-90160f07bf61@gmail.com> In-Reply-To: <2A7A1E60-766D-427B-8288-E92B4090022E@gmail.com> References: <D5749BDF-36B5-4AE9-A75F-2A702DF71F8C@gmail.com> <20210703065420.6dbafb5f@ernst.home> <D542E8C1-4E97-48E8-8748-BBA19B2216EC@gmail.com> <2390FA9B-319E-45D4-BEA7-10878E43AD4B@gmail.com> <YONVgjgqREDAucok@kib.kiev.ua> <2A7A1E60-766D-427B-8288-E92B4090022E@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2021/7/6 3:47 AM, Vitaliy Gusev wrote: >> On 5 Jul 2021, at 21:54, Konstantin Belousov <kostikbel@gmail.com> wrote: >> >> On Mon, Jul 05, 2021 at 07:32:00PM +0300, Vitaliy Gusev wrote: >> >> DONTNEED does not allow system to free pages at all. It means that pages >> are less useful and can be paged out with higher priority. >> > > That caused behaviour that memory is not freed! > > Is there a reason why FreeBSD behaviour for MADV_DONTNEED is different than in Linux and illumos ? Why it needs swap and cannot be easily dropped ? > Illumos has a similar behavior as FreeBSD in the way that it does not destroy content of the underlying object. The operation you described in Illumos is MAP_PURGE which is intended to be a bug-to-bug compatible interface. See: https://github.com/illumos/illumos-gate/commit/8905f42caceb9f470ffaa19e5f6c9fb6184d12c0 for full context. Ka Ho
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4cab2b26-e9cb-6ca7-fbd1-90160f07bf61>