Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2009 10:22:53 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        arch@freebsd.org, Robert Watson <rwatson@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>
Subject:   Re: Simple #define for cache line size
Message-ID:  <200904131022.53882.jhb@freebsd.org>
In-Reply-To: <49E0D353.7090308@freebsd.org>
References:  <alpine.BSF.2.00.0904111700241.19879@fledge.watson.org> <49E0D353.7090308@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 11 April 2009 1:28:51 pm Nathan Whitehorn wrote:
> Robert Watson wrote:
> >
> >
> > NetBSD, FYI, defines CACHE_LINE_SIZE as a global constant in param.h, 
> > but I'm going with an MD definition as I suspect people will want to 
> > do different things on different architectures (and there is 
> > variation).  I've defaulted all architectures to 64 bytes, but I 
> > suspect a number would prefer to use 32.
> For what it's worth, this is per-CPU variable on PowerPC and detected at 
> runtime. Most of the CPUs we support have 32 byte cache lines, but some 
> (e.g. the G5) use 128 bytes. I'm not sure there is a general solution in 
> this case, but that's the situation on PPC.
> -Nathan

I think UMA can handle a variable size and that should be preserved.  However, 
for the purposes of aligned() I think a constant that is the maximum size 
(such as 128 on ppc) might work best.

-- 
John Baldwin



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