alexander.kjeldaas at gmail.com
Thu Aug 18 12:43:58 CEST 2011
On 18 August 2011 12:29, Johan Tibell <johan.tibell at gmail.com> wrote:
> On Thu, Aug 18, 2011 at 12:22 PM, Alexander Kjeldaas
> <alexander.kjeldaas at gmail.com> wrote:
> > The Nehalem micro-architecture has made unaligned loads very cheap, as
> > as they do not cross a cache line boundary.
> > I am thinking that this makes it possible for ghc to use 40-bit pointers,
> > and generally use "packed" structure layout. This again should improve
> > performance by increasing the effective CPU cache size.
> > Even given a packed structure layout, the memory allocator could be
> > to ensure that no object field will cross a cache line by moving the
> > a few bytes in either direction.
> > Comments? How hard-coded is the ghc object layout?
> I believe there are lots of assumptions about the alignment of heap
> objects i.e. we use word sized loads which would fail on some
> architectures if allocated memory wasn't word aligned.
Unaligned word-sized loads work fine on x86, and this would be x86-64 only,
or even Nehalem (and later) only. Or, from a cost perspective, it could
be interesting for non-Nehalem as well, as RAM is (usually) the most
expensive component when running a server. (But anyways, developing
features for pre-Nehalem is slightly pointless IMHO).
So I guess the alignment would be per-architecture or a flag. If it is
currently hardcoded, it would have to be configurable.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cvs-ghc