svn commit: r336047 - in head/sys: amd64/include i386/include sys

Gleb Smirnoff glebius at freebsd.org
Tue Aug 7 22:00:32 UTC 2018


On Sat, Aug 04, 2018 at 10:48:17AM +0300, Konstantin Belousov wrote:
K> On Fri, Aug 03, 2018 at 03:27:39PM -0700, Gleb Smirnoff wrote:
K> >   Hi Konstantin,
K> > 
K> > On Fri, Jul 06, 2018 at 07:50:44PM +0000, Konstantin Belousov wrote:
K> > K> Author: kib
K> > K> Date: Fri Jul  6 19:50:44 2018
K> > K> New Revision: 336047
K> > K> URL: https://svnweb.freebsd.org/changeset/base/336047
K> > K> 
K> > K> Log:
K> > K>   Expand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE.
K> > K>   
K> > K>   This restores counters(9) operation.
K> > K>   Revert r336024. Improve assert of pcpu size on x86.
K> > K>   
K> > K>   Reviewed by:	mmacy
K> > K>   Sponsored by:	The FreeBSD Foundation
K> > K>   Differential revision:	https://reviews.freebsd.org/D16163
K> > 
K> > Since this has been broken already several times as people who edit
K> > surrounding code don't understand the magic, and since now we round
K> > the struct pcpu size to PAGE_SIZE anyways, what about stop carefully
K> > craft the padding and just change alignment of struct pcpu to PAGE_SIZE?
K> I do not see how it would avoided that breakage.  Also, I like the
K> explicitness in the padding, it is useful when new pcpu members are
K> added.  I have to do that more than once this year.

I was wrong. __aligned would do proper placement of items in an array,
but sizeof would return lesser value.

-- 
Gleb Smirnoff


More information about the svn-src-all mailing list