From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:49:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8CAA106564A; Sat, 1 May 2010 14:49:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id BC1A08FC1B; Sat, 1 May 2010 14:49:33 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so200046fge.13 for ; Sat, 01 May 2010 07:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=KibVxe6aDiATPp7FkPICdg79mdkrmgqZqhb0TEyQidk=; b=hKZGUexI5tUFzojtsJPBM4MJnCqf4flpV6+5YFlhcb/iLVszbYrPUOdatq35NwntIH f/2JMCBlgI5JX+HIaHYW6Eg783IKyBXOOHqL/uaKHRCcyqhbEhNP3UWe6UKX1HTfYQ9t SvQ2gSXUivlUWvwtjg5owoiw1m5xEzhEqurJA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=F+dcmT6jQHiGcWQF9Y/RdtHlPRZDeHhJWkwLpUDgf1jscwSzJf1prjZFVb+Ugt8mJS 4N8lovr27tbl8ZzN8mfgcjoq1kJzNCM2XLjJ12guc7ZPfWpoIqq81GI7QG7nIiZlNV/4 a/Og5b6KrxK6bXr+IdTSZ5dFFje02KUYTN53g= MIME-Version: 1.0 Received: by 10.239.142.18 with SMTP id e18mr314269hba.52.1272725365740; Sat, 01 May 2010 07:49:25 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.239.129.207 with HTTP; Sat, 1 May 2010 07:49:25 -0700 (PDT) In-Reply-To: <201005010341.o413fMhP067068@svn.freebsd.org> References: <201005010341.o413fMhP067068@svn.freebsd.org> Date: Sat, 1 May 2010 16:49:25 +0200 X-Google-Sender-Auth: L7_jm6FH3yN_Hs0GbXP4t5R9bM8 Message-ID: From: Attilio Rao To: Kip Macy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207460 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 14:49:34 -0000 2010/5/1 Kip Macy : > Author: kmacy > Date: Sat May =C2=A01 03:41:21 2010 > New Revision: 207460 > URL: http://svn.freebsd.org/changeset/base/207460 > > Log: > =C2=A0Update locking comment above vm_page: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - re-assign page queue lock "Q" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - assign page lock "P" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - update several uncommented fields > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - observe that hold_count is now protected by= the page lock "P" > > Modified: > =C2=A0head/sys/vm/vm_page.h > > Modified: head/sys/vm/vm_page.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/vm/vm_page.h =C2=A0 =C2=A0 =C2=A0 Sat May =C2=A01 02:53:43 2= 010 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r207459) > +++ head/sys/vm/vm_page.h =C2=A0 =C2=A0 =C2=A0 Sat May =C2=A01 03:41:21 2= 010 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r207460) > @@ -90,20 +90,21 @@ > =C2=A0* =C2=A0 =C2=A0 and sundry status bits. > =C2=A0* > =C2=A0* =C2=A0 =C2=A0 Fields in this structure are locked either by the l= ock on the > - * =C2=A0 =C2=A0 object that the page belongs to (O) or by the lock on t= he page > - * =C2=A0 =C2=A0 queues (P). > + * =C2=A0 =C2=A0 object that the page belongs to (O), its corresponding = page lock (P), > + * =C2=A0 =C2=A0 or by the lock on the page queues (Q). > + * > =C2=A0*/ > > =C2=A0TAILQ_HEAD(pglist, vm_page); > > =C2=A0struct vm_page { > - =C2=A0 =C2=A0 =C2=A0 TAILQ_ENTRY(vm_page) pageq; =C2=A0 =C2=A0 /* queue= info for FIFO queue or free list (P) */ > + =C2=A0 =C2=A0 =C2=A0 TAILQ_ENTRY(vm_page) pageq; =C2=A0 =C2=A0 /* queue= info for FIFO queue or free list (Q) */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0TAILQ_ENTRY(vm_page) listq; =C2=A0 =C2=A0 /* p= ages in same object (O) =C2=A0 =C2=A0 */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0struct vm_page *left; =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 /* splay tree link (O) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > =C2=A0 =C2=A0 =C2=A0 =C2=A0struct vm_page *right; =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0/* splay tree link (O) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > > - =C2=A0 =C2=A0 =C2=A0 vm_object_t object; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* which object am I in (O,P)*/ > - =C2=A0 =C2=A0 =C2=A0 vm_pindex_t pindex; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* offset into object (O,P) */ > + =C2=A0 =C2=A0 =C2=A0 vm_object_t object; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* which object am I in (O,Q)*/ > + =C2=A0 =C2=A0 =C2=A0 vm_pindex_t pindex; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* offset into object (O,Q) */ This notation is ambigous. It doesn't let understand if the lock may be held both together or not, which rules happen for reading/writing such values, etc. May you please follow well-known patterns like the tables in subr_turnstile.c ? (+ for both of them, / for one of them, clarify if it is safe to read them with just one lock of them held, etc). Attilio --=20 Peace can only be achieved by understanding - A. Einstein