From owner-freebsd-alpha Fri May 10 18:42:38 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 3017237B401; Fri, 10 May 2002 18:42:35 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id VAA27926; Fri, 10 May 2002 21:42:34 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g4B1g4N84685; Fri, 10 May 2002 21:42:04 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15580.30444.495695.505343@grasshopper.cs.duke.edu> Date: Fri, 10 May 2002 21:42:04 -0400 (EDT) To: John Baldwin Cc: obrien@FreeBSD.org, alpha@FreeBSD.org, Jeff Roberson , alc@FreeBSD.org Subject: Re: gcc3 & alpha kernels In-Reply-To: References: <15580.13914.162169.930227@grasshopper.cs.duke.edu> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin writes: > This is the first atomic_cmpset_int() loop. The problem is that when > we copy t0 to t1, we zapnot more bits. The reason is that t1 is a short, > not an int. The reason for that is that for some weird reason, > object->pg_color is a u_short even though next_index and incr are ints. So > gcc currectly converts the unsigned short value in object->pg_color to an > int for atomic_cmpset_int() and if next_index has wrapped we are screwed. Very nice work! > One fix would be to cast object->pg_color to an int for this call but that > still has wrapping issues. A better fix is probably to stop microptimizing > struct vm_object and use a int for pg_color. I suggest that all the atomic I agree. At least on 64-bit platformas, you can probably get that size back by swapping (32-bit)generation & (64-bit)size -- eg, do to alignment, 32-bits is currently wasted. Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message