Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jan 2019 17:54:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        emulation@FreeBSD.org
Subject:   [Bug 230160] linuxulator doesn't implement madvise(MADV_DONTNEED) correctly
Message-ID:  <bug-230160-4077-P4O934ncSk@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-230160-4077@https.bugs.freebsd.org/bugzilla/>

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

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230160

--- Comment #2 from Mark Johnston <markj@FreeBSD.org> ---
Yes, we should probably just extend our madvise(2) to implement Linux's
MADV_DONTNEED.  Some care is needed, as we currently assume that madvise(2) is
advisory and so may be ignored for pages in some transient busy state. 
However, we cannot correctly do this when implementing Linux MADV_DONTNEED for
private anonymous memory.

I don't really like the idea of having a generic MADV_ZERO.  First, Linux
MADV_DONTNEED only "zeroes" the page if it belongs to a private mapping.  Pages
belonging to shared mappings should be handled the same way as FreeBSD's
MADV_DONTNEED, from my reading of the man page.  So that name would be
misleading.  Second, I think it's pretty widely agreed that Linux's
implementation choice here is a historical mistake.  We should emulate it, but
I don't think it makes much sense to do so in a generic fashion.  I'd just add
an undocumented MADV_DONTNEED_LINUX.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-230160-4077-P4O934ncSk>