Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Sep 2017 09:18:59 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: UMA and zone alignment
Message-ID:  <4524093.e3VFLNUReg@ralph.baldwin.cx>
In-Reply-To: <CABh_MKnyDp-FjN38cmXCUq9SHLBdcQbTrekvjwU948=oWE70RA@mail.gmail.com>
References:  <10066620.9raPCKhsf8@ralph.baldwin.cx> <CABh_MKnyDp-FjN38cmXCUq9SHLBdcQbTrekvjwU948=oWE70RA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, September 16, 2017 07:54:47 AM Ed Schouten wrote:
> 2017-09-16 0:38 GMT+01:00 John Baldwin <jhb@freebsd.org>:
> > I think I'd like to add UMA_ALIGNOF() and encourage UMA zones to use
> > UMA_ALIGNOF(type) instead of UMA_ALIGN_PTR, etc. going forward.  This would
> > mean UMA would then honor 'struct foo { ... } __aligned(XX)', etc.  What do
> > you all think?
> 
> Awesome!
> 
> Random remark: it looks like uma_zcreate() already takes the size of
> the objects to allocate without any wrapping; it's just sizeof(...).
> Wouldn't we be able to do this for alignment as well?
> 
> More specifically, if all of the UMA_ALIGN_* definitions were
> incremented by one and uma_zcreate() decrements it, we could eliminate
> the UMA_ALIGNOF() macro entirely and simply use _Alignof() at the call
> site directly.

Fixing this part of the UMA API is also on my todo list, but I haven't
gotten to it yet (and this is quicker to fix). 

-- 
John Baldwin



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