Date: Mon, 13 May 2013 01:37:27 +0400 From: Andrey Chernov <ache@freebsd.org> To: Alan Cox <alc@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r250577 - head/sys/vm Message-ID: <51900B97.20406@freebsd.org> In-Reply-To: <201305121650.r4CGoJL0087149@svn.freebsd.org> References: <201305121650.r4CGoJL0087149@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12.05.2013 20:50, Alan Cox wrote: GNU cc errors related to part of diff below: cc1: warnings being treated as errors ../../../vm/vm_page.c: In function 'vm_page_alloc': ../../../vm/vm_page.c:1209: warning: 'mpred' may be used uninitialized in this function *** [vm_page.o] Error code 1 Formally yes, mpred here can be left unitialized. > @@ -1179,7 +1206,7 @@ vm_page_alloc(vm_object_t object, vm_pin > { > struct vnode *vp = NULL; > vm_object_t m_object; > - vm_page_t m; > + vm_page_t m, mpred; > int flags, req_class; > > KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0), > @@ -1195,6 +1222,11 @@ vm_page_alloc(vm_object_t object, vm_pin > if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) > req_class = VM_ALLOC_SYSTEM; > > + if (object != NULL) { > + mpred = vm_radix_lookup_le(&object->rtree, pindex); > + KASSERT(mpred == NULL || mpred->pindex != pindex, > + ("vm_page_alloc: pindex already allocated")); > + } > mtx_lock(&vm_page_queue_free_mtx); > if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || > (req_class == VM_ALLOC_SYSTEM && > @@ -1225,8 +1257,8 @@ vm_page_alloc(vm_object_t object, vm_pin > return (NULL); > #if VM_NRESERVLEVEL > 0 > } else if (object == NULL || (object->flags & (OBJ_COLORED | > - OBJ_FICTITIOUS)) != OBJ_COLORED || > - (m = vm_reserv_alloc_page(object, pindex)) == NULL) { > + OBJ_FICTITIOUS)) != OBJ_COLORED || (m = > + vm_reserv_alloc_page(object, pindex, mpred)) == NULL) { > #else > } else { > #endif > @@ -1320,7 +1352,7 @@ vm_page_alloc(vm_object_t object, vm_pin > if (object->memattr != VM_MEMATTR_DEFAULT && > (object->flags & OBJ_FICTITIOUS) == 0) > pmap_page_set_memattr(m, object->memattr); > - vm_page_insert(m, object, pindex); > + vm_page_insert_after(m, object, pindex, mpred); > } else > m->pindex = pindex; -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51900B97.20406>