Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2002 21:42:04 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        obrien@FreeBSD.org, alpha@FreeBSD.org, Jeff Roberson <jroberson@chesapeake.net>, alc@FreeBSD.org
Subject:   Re: gcc3 & alpha kernels
Message-ID:  <15580.30444.495695.505343@grasshopper.cs.duke.edu>
In-Reply-To: <XFMail.20020510204837.jhb@FreeBSD.org>
References:  <15580.13914.162169.930227@grasshopper.cs.duke.edu> <XFMail.20020510204837.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15580.30444.495695.505343>