Date: Thu, 10 Jan 2013 17:03:31 +0300 From: Sergey Kandaurov <pluknet@gmail.com> To: Andrey Zonov <zont@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r245255 - head/sys/vm Message-ID: <CAE-mSO%2B=d8gknb2BJ%2BsERe-zsYD8L3Or6Yk2mSNak7c0yjDVdw@mail.gmail.com> In-Reply-To: <201301101243.r0AChwR7090554@svn.freebsd.org> References: <201301101243.r0AChwR7090554@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10 January 2013 16:43, Andrey Zonov <zont@freebsd.org> wrote: > Author: zont > Date: Thu Jan 10 12:43:58 2013 > New Revision: 245255 > URL: http://svnweb.freebsd.org/changeset/base/245255 > > Log: > - Reduce kernel size by removing unnecessary pointer indirections. > > GENERIC kernel size reduced in 16 bytes and RACCT kernel in 336 bytes. > > Suggested by: alc > Reviewed by: alc > Approved by: kib (mentor) > MFC after: 1 week > > Modified: > head/sys/vm/vm_map.c > head/sys/vm/vm_mmap.c > head/sys/vm/vm_unix.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Thu Jan 10 12:30:58 2013 (r245254) > +++ head/sys/vm/vm_map.c Thu Jan 10 12:43:58 2013 (r245255) [...] > @@ -3505,8 +3504,7 @@ Retry: > grow_amount = limit - ctob(vm->vm_ssize); > #endif > if (!old_mlock && map->flags & MAP_WIREFUTURE) { > - if (ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount > > - lmemlim) { > + if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > lmemlim) { > vm_map_unlock_read(map); > rv = KERN_NO_SPACE; > goto out; > @@ -3514,7 +3512,7 @@ Retry: > #ifdef RACCT > PROC_LOCK(p); > if (racct_set(p, RACCT_MEMLOCK, > - ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount)) { > + ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { > PROC_UNLOCK(p); > vm_map_unlock_read(map); > rv = KERN_NO_SPACE; > @@ -3645,7 +3643,7 @@ out: > KASSERT(error == 0, ("decreasing RACCT_VMEM failed")); > if (!old_mlock) { > error = racct_set(p, RACCT_MEMLOCK, > - ptoa(vmspace_wired_count(p->p_vmspace))); > + ptoa(pmap_wired_count(map->pmap))); > KASSERT(error == 0, ("decreasing RACCT_MEMLOCK failed")); > } > error = racct_set(p, RACCT_STACK, ctob(vm->vm_ssize)); > Hi, although vm_fault_hold() is the only caller of vm_map_growstack() and it passes curproc as a process argument, this is a public function and more callers can grow theoretically with !curproc. For the reason, shouldn't vmspace be used with vmspace_acquire_ref()/vmspace_free() ? Just nitpicking.. -- wbr, pluknet
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSO%2B=d8gknb2BJ%2BsERe-zsYD8L3Or6Yk2mSNak7c0yjDVdw>