From owner-svn-src-head@FreeBSD.ORG Tue Apr 9 19:53:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E22BB4B6; Tue, 9 Apr 2013 19:53:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BF50592C; Tue, 9 Apr 2013 19:53:23 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 82F23B915; Tue, 9 Apr 2013 15:53:20 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r249265 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sys Date: Tue, 9 Apr 2013 15:20:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304081919.r38JJAvB088644@svn.freebsd.org> <201304081541.27408.jhb@freebsd.org> <20130408194436.GI76816@FreeBSD.org> In-Reply-To: <20130408194436.GI76816@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201304091520.25575.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 09 Apr 2013 15:53:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 19:53:24 -0000 On Monday, April 08, 2013 3:44:36 pm Gleb Smirnoff wrote: > On Mon, Apr 08, 2013 at 03:41:27PM -0400, John Baldwin wrote: > J> On Monday, April 08, 2013 3:19:10 pm Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Mon Apr 8 19:19:10 2013 > J> > New Revision: 249265 > J> > URL: http://svnweb.freebsd.org/changeset/base/249265 > J> > > J> > Log: > J> > Merge from projects/counters: > J> > > J> > Pad struct pcpu so that its size is denominator of PAGE_SIZE. This > J> > is done to reduce memory waste in UMA_PCPU_ZONE zones. > J> > > J> > Sponsored by: Nginx, Inc. > J> > > J> > Modified: head/sys/sys/pcpu.h > J> > > J> ============================================================================== > J> > --- head/sys/sys/pcpu.h Mon Apr 8 19:10:45 2013 (r249264) > J> > +++ head/sys/sys/pcpu.h Mon Apr 8 19:19:10 2013 (r249265) > J> > @@ -180,6 +180,14 @@ struct pcpu { > J> > PCPU_MD_FIELDS; > J> > } __aligned(CACHE_LINE_SIZE); > J> > J> Why not change this to be PAGE_SIZE rather than putting explicit padding in > J> all the pcpu fields? That would seem to be more maintainable. > > Because it can be smaller than PAGE_SIZE. Two times smaller, four times smaller. Ugh, I didn't parse the "denominator" part correctly. I had read it as "multiple". OTOH, it seems quite cheap even on a 32-bit platform to lose 3k per core (assuming 4k page size and 1k pcpu). -- John Baldwin