From owner-svn-src-head@FreeBSD.ORG Wed May 15 05:25:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDCAE468; Wed, 15 May 2013 05:25:43 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mail1.ozon.ru (mx4.ozon.ru [194.186.179.140]) by mx1.freebsd.org (Postfix) with ESMTP id A4297C29; Wed, 15 May 2013 05:25:40 +0000 (UTC) Received: from intmail03msk.ozon (intmail03msk.ozon [10.18.18.171]) by mail1.ozon.ru (Postfix) with ESMTP id 5B78E71AB4F; Wed, 15 May 2013 09:25:09 +0400 (MSK) Received: from mail pickup service by intmail03msk.ozon with Microsoft SMTPSVC; Wed, 15 May 2013 09:05:13 +0400 Received: from intmail03msk.ozon ([10.18.18.171]) by intmail02msk.ozon with Microsoft SMTPSVC(6.0.3790.4675); Mon, 13 May 2013 01:49:32 +0400 Received: from mail1.ozon.ru ([194.186.179.140]) by intmail03msk.ozon with Microsoft SMTPSVC(6.0.3790.4675); Mon, 13 May 2013 01:49:32 +0400 Received: from localhost (localhost [127.0.0.1]) by mail1.ozon.ru (Postfix) with ESMTP id 6F73F7199D2 for ; Mon, 13 May 2013 01:49:32 +0400 (MSK) X-Virus-Scanned: amavisd-new at ozon.ru Received: from mail1.ozon.ru ([127.0.0.1]) by localhost (mx4.ozon.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PfWwd+eZaf86 for ; Mon, 13 May 2013 01:49:23 +0400 (MSK) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received-SPF: pass (freebsd.org: 8.8.178.116 is authorized to use 'owner-svn-src-all@freebsd.org' in 'mfrom' identity (mechanism 'ip4:8.8.178.116' matched)) receiver=mx4.ozon.ru; identity=mfrom; envelope-from="owner-svn-src-all@freebsd.org"; helo=mx2.freebsd.org; client-ip=8.8.178.116 Received: from mx2.freebsd.org (mx2.FreeBSD.org [8.8.178.116]) by mail1.ozon.ru (Postfix) with ESMTP id 8BA5B719981 for ; Mon, 13 May 2013 01:49:23 +0400 (MSK) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id AC7241074; Sun, 12 May 2013 21:49:22 +0000 (UTC) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by hub.freebsd.org (Postfix) with ESMTP id 94F79E7F; Sun, 12 May 2013 21:49:22 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7427BD34; Sun, 12 May 2013 21:49:14 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) by mx1.freebsd.org (Postfix) with ESMTP id 4468C14E; Sun, 12 May 2013 21:49:13 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r4CLHtTE017720; Sun, 12 May 2013 16:49:13 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp1.rice.edu with ESMTP id 1c3847mpqa-1; Sun, 12 May 2013 16:49:12 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 547A74C01BC; Sun, 12 May 2013 16:49:12 -0500 (CDT) Message-ID: <51900E57.80608@rice.edu> Date: Sun, 12 May 2013 16:49:11 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andrey Chernov Subject: Re: svn commit: r250577 - head/sys/vm References: <201305121650.r4CGoJL0087149@svn.freebsd.org> <51900B97.20406@freebsd.org> In-Reply-To: <51900B97.20406@freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: owner-svn-src-all@freebsd.org Sender: owner-svn-src-all@freebsd.org X-OriginalArrivalTime: 12 May 2013 21:49:32.0201 (UTC) FILETIME=[95F7A990:01CE4F5A] Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 05:25:43 -0000 On 05/12/2013 16:37, Andrey Chernov wrote: > 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. No, it can't. The code amounts to if ("x") mpred = ... ; ... if ("x") use mpred; ... if ("x") use mpred; where "x" is "object != NULL". Moreover, there are no assignments to the variable "object" or aliases by which the variable "object" can be modified over the lifespan of "mpred". So, this is flawed analysis by our antique gcc. >> @@ -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; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"