Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2014 17:38:41 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270883 - head/sys/kern
Message-ID:  <201408311738.s7VHcfvn065610@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Aug 31 17:38:41 2014
New Revision: 270883
URL: http://svnweb.freebsd.org/changeset/base/270883

Log:
  Automatically prefault a limited number of mappings to resident pages in
  shmat(2), just like mmap(2).
  
  MFC after:	5 days
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Sun Aug 31 17:21:51 2014	(r270882)
+++ head/sys/kern/sysv_shm.c	Sun Aug 31 17:38:41 2014	(r270883)
@@ -410,9 +410,9 @@ kern_shmat(td, shmid, shmaddr, shmflg)
 	}
 
 	vm_object_reference(shmseg->object);
-	rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object,
-	    0, &attach_va, size, 0, shmaddr != NULL ? VMFS_NO_SPACE :
-	    VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE);
+	rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va,
+	    size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE,
+	    prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL);
 	if (rv != KERN_SUCCESS) {
 		vm_object_deallocate(shmseg->object);
 		error = ENOMEM;



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