Author: markj
Date: Mon Aug 17 17:14:56 2020
New Revision: 364317
URL: https://svnweb.freebsd.org/changeset/base/364317

Log:
  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

Modified:
  head/sys/compat/linux/linux_mmap.c

Modified: head/sys/compat/linux/linux_mmap.c
==============================================================================
--- head/sys/compat/linux/linux_mmap.c  Mon Aug 17 17:07:05 2020        
(r364316)
+++ head/sys/compat/linux/linux_mmap.c  Mon Aug 17 17:14:56 2020        
(r364317)
@@ -282,6 +282,8 @@ linux_madvise_dontneed(struct thread *td, vm_offset_t 
                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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to