Skip Linux madvise(MADV_DONTNEED) on unmanaged objects.

vm_object_madvise() is a no-op for unmanaged objects, but we should also
limit the scope of mappings on which pmap_remove() is called.  In
particular, with the WIP largepage shm objects patch the kernel must
remove mappings of such objects along superpage boundaries, and without
this check Linux madvise(MADV_DONTNEED) could violate that requirement.

Reviewed by:	alc, kib
MFC with:	r362631
Sponsored by:	Juniper Networks, Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D26084
This commit is contained in:
Mark Johnston 2020-08-17 17:14:56 +00:00
parent cb1480f8d4
commit 30dcce2709

@ -282,6 +282,8 @@ linux_madvise_dontneed(struct thread *td, vm_offset_t start, vm_offset_t end)
object = entry->object.vm_object;
if (object == NULL)
continue;
if ((object->flags & (OBJ_UNMANAGED | OBJ_FICTITIOUS)) != 0)
continue;
pstart = OFF_TO_IDX(entry->offset);
if (start > entry->start) {