Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Aug 2020 17:14:57 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364317 - head/sys/compat/linux
Message-ID:  <202008171714.07HHEvRV020332@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008171714.07HHEvRV020332>