Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 15:01:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 240061] MADV_FREE rewinds time to before fork()
Message-ID:  <bug-240061-227-RHV8r9O8Tp@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-240061-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-240061-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240061

--- Comment #6 from Mark Johnston <markj@FreeBSD.org> ---
One possible alternative is to convert MADV_FREE to MADV_DONTNEED if the ob=
ject
has a backing object.  pmap_advise() needs to be updated to preserve the
modified bits, but this should be fine since vm_page_advise(MADV_FREE) calls
vm_page_undirty() anyway.

Some basic testing on my workstation showed that virtually all calls to
vm_object_madvise(MADV_FREE) are acting on an object with no backing object=
.=20
Obviously this may not be true in general.

# dtrace -n 'fbt::vm_object_madvise:entry /args[0] && args[3] =3D=3D
5/{@[args[0]->backing_object =3D=3D NULL] =3D count();}'
^C
        0               13
        1            17504

Untested patch here: https://people.freebsd.org/~markj/patches/madvise_cow.=
diff

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240061-227-RHV8r9O8Tp>