From owner-svn-src-all@FreeBSD.ORG Sun Aug 31 17:38:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11F4233F; Sun, 31 Aug 2014 17:38:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1EDE120B; Sun, 31 Aug 2014 17:38:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VHcfII065611; Sun, 31 Aug 2014 17:38:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VHcfvn065610; Sun, 31 Aug 2014 17:38:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201408311738.s7VHcfvn065610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 31 Aug 2014 17:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270883 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 17:38:42 -0000 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;