Date: Sun, 2 Dec 2018 12:35:49 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341395 - stable/12/sys/vm Message-ID: <201812021235.wB2CZnAT084678@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Dec 2 12:35:48 2018 New Revision: 341395 URL: https://svnweb.freebsd.org/changeset/base/341395 Log: MFC r340922: Avoid unneeded check in vmspace_alloc(). Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Sun Dec 2 07:45:22 2018 (r341394) +++ stable/12/sys/vm/vm_map.c Sun Dec 2 12:35:48 2018 (r341395) @@ -283,12 +283,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_p struct vmspace *vm; vm = uma_zalloc(vmspace_zone, M_WAITOK); - KASSERT(vm->vm_map.pmap == NULL, ("vm_map.pmap must be NULL")); - - if (pinit == NULL) - pinit = &pmap_pinit; - if (!pinit(vmspace_pmap(vm))) { uma_zfree(vmspace_zone, vm); return (NULL); @@ -3424,7 +3419,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c old_map = &vm1->vm_map; /* Copy immutable fields of vm1 to vm2. */ - vm2 = vmspace_alloc(vm_map_min(old_map), vm_map_max(old_map), NULL); + vm2 = vmspace_alloc(vm_map_min(old_map), vm_map_max(old_map), + pmap_pinit); if (vm2 == NULL) return (NULL); vm2->vm_taddr = vm1->vm_taddr; @@ -3975,7 +3971,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser, vm_o KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, ("vmspace_exec recursed")); - newvmspace = vmspace_alloc(minuser, maxuser, NULL); + newvmspace = vmspace_alloc(minuser, maxuser, pmap_pinit); if (newvmspace == NULL) return (ENOMEM); newvmspace->vm_swrss = oldvmspace->vm_swrss;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812021235.wB2CZnAT084678>