From owner-svn-src-user@FreeBSD.ORG Tue Mar 12 16:34:56 2013 Return-Path: Delivered-To: svn-src-user@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 DD0E9DC5; Tue, 12 Mar 2013 16:34:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 945C3B6D; Tue, 12 Mar 2013 16:34:56 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id c12so46341ieb.20 for ; Tue, 12 Mar 2013 09:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zzQhZjcXP2954E7EAyOUD6SIiJDZX9w4ocykuiB2l14=; b=vhCD8rbxteIfnd3/3i28b4XbSCz8+CDNO6JKU0aHajTJwGUk6pQ0E3vYyfzgzOJL44 2EUhNfZVR1EyMUd64+4XnvDxVl38TBaTUhfi5P4+s9dTmB2E4SKM0jk+oE3qZkHPLlJB qAeuguyi9G/eqrRX4S/hFLQY+ySGXXUK0j/3/yzNvQ/vnXnKZLEaT4Ye4SoJflT1+fuD CS1Sd+cSfAexTrvVcyv04ikBOyngzJbBftRZwMuOZrrT3X5J+55ugdxCDIhH++YEj/bl eIDG0CE4JW+gdIiZqJ7NLavV7U50sNqr6MzkybMq1Mnv6qswYR37Z9FLLiO7GO04Nr7t 5Xqg== MIME-Version: 1.0 X-Received: by 10.50.203.3 with SMTP id km3mr12633239igc.64.1363106096222; Tue, 12 Mar 2013 09:34:56 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Tue, 12 Mar 2013 09:34:56 -0700 (PDT) In-Reply-To: <513F571A.5070007@rice.edu> References: <201303120614.r2C6EWve058965@svn.freebsd.org> <513F571A.5070007@rice.edu> Date: Tue, 12 Mar 2013 17:34:56 +0100 X-Google-Sender-Auth: TLatl20kxCc7ieNlLYBJBrPsSVw Message-ID: Subject: Re: svn commit: r248185 - user/attilio/vmcontention/sys/vm From: Attilio Rao To: Alan Cox Content-Type: text/plain; charset=UTF-8 Cc: Alan Cox , src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2013 16:34:56 -0000 On Tue, Mar 12, 2013 at 5:26 PM, Alan Cox wrote: > On 03/12/2013 07:04, Attilio Rao wrote: >> On Tue, Mar 12, 2013 at 7:14 AM, Alan Cox wrote: >>> Author: alc >>> Date: Tue Mar 12 06:14:31 2013 >>> New Revision: 248185 >>> URL: http://svnweb.freebsd.org/changeset/base/248185 >>> >>> Log: >>> When transferring the page from one object to another, don't insert the >>> page into its new object until the page's pindex has been updated. >>> Otherwise, one code path within vm_radix_insert() may use the wrong >>> pindex value. >> This is just a style change really because the code already subtracts >> offindxstart from current m->pindex when inserting. The pindex on the >> page is then adjusted when the real subtraction happens. >> IIRC, I did this way because of less diffs against -CURRENT, but the >> code looks correct to me already in the older version. >> > > No, as I say in the commit message, there is a path in vm_radix_insert() > that uses "page->pindex" and not the "index" argument: > > /* > * A new node is needed because the right insertion level is > reached. > * Setup the new intermediate node and add the 2 children: the > * new object and the older edge. > */ > tmp2 = vm_radix_node_get(vm_radix_trimkey(page->pindex, clev - > 1), 2, > clev); > > Prior to this change, if we follow this path, then we are using the > wrong "pindex" value at this point in vm_radix_insert(). My bad, that should use "index" as it was supposed to be, not the page one. I likely added it as a cleanup after having reworked all the other functions, introducing the bug. It is courious it never showed up. I'd rather fix vm_radix_insert() to not consider the page index. This is a step forward anyway in generalizing the code. Attilio -- Peace can only be achieved by understanding - A. Einstein