From owner-svn-src-all@FreeBSD.ORG Thu Mar 18 09:35:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CCF106564A; Thu, 18 Mar 2010 09:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 55A0B8FC19; Thu, 18 Mar 2010 09:35:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CD61A41C712; Thu, 18 Mar 2010 10:35:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id l6PCXk+0wifL; Thu, 18 Mar 2010 10:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 5FEFD41C707; Thu, 18 Mar 2010 10:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id F18AA4448EC; Thu, 18 Mar 2010 09:32:13 +0000 (UTC) Date: Thu, 18 Mar 2010 09:32:13 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Kip Macy In-Reply-To: <201003172118.o2HLIS4X020099@svn.freebsd.org> Message-ID: <20100318092936.J33454@maildrop.int.zabbadoz.net> References: <201003172118.o2HLIS4X020099@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205266 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2010 09:35:07 -0000 On Wed, 17 Mar 2010, Kip Macy wrote: > Author: kmacy > Date: Wed Mar 17 21:18:28 2010 > New Revision: 205266 > URL: http://svn.freebsd.org/changeset/base/205266 > > Log: > Cache line align various structures and move volatile counters to > not share a cache line with (mostly) immutable state > > Reviewed by: jeff@ > MFC after: 7 days I think that this would require a rebuild of some user space parts query uma statistics and in general, though we try to hide everything with accessor functions, there might be modules directly accessing uma_zone_t * fileds. I think this at least needs an entry in UPDATING, if not a __FreeBSD_version bump. > Modified: > head/sys/vm/uma_int.h > > Modified: head/sys/vm/uma_int.h > ============================================================================== > --- head/sys/vm/uma_int.h Wed Mar 17 21:11:48 2010 (r205265) > +++ head/sys/vm/uma_int.h Wed Mar 17 21:18:28 2010 (r205266) > @@ -160,6 +160,11 @@ struct uma_hash { > }; > > /* > + * align field or structure to cache line > + */ > +#define UMA_ALIGN __aligned(CACHE_LINE_SIZE) > + > +/* > * Structures for per cpu queues. > */ > > @@ -168,7 +173,7 @@ struct uma_bucket { > int16_t ub_cnt; /* Count of free items. */ > int16_t ub_entries; /* Max items. */ > void *ub_bucket[]; /* actual allocation storage */ > -}; > +} UMA_ALIGN; > > typedef struct uma_bucket * uma_bucket_t; > > @@ -177,7 +182,7 @@ struct uma_cache { > uma_bucket_t uc_allocbucket; /* Bucket to allocate from */ > u_int64_t uc_allocs; /* Count of allocations */ > u_int64_t uc_frees; /* Count of frees */ > -}; > +} UMA_ALIGN; > > typedef struct uma_cache * uma_cache_t; > > @@ -312,11 +317,12 @@ struct uma_zone { > uma_init uz_init; /* Initializer for each item */ > uma_fini uz_fini; /* Discards memory */ > > - u_int64_t uz_allocs; /* Total number of allocations */ > - u_int64_t uz_frees; /* Total number of frees */ > - u_int64_t uz_fails; /* Total number of alloc failures */ > u_int32_t uz_flags; /* Flags inherited from kegs */ > u_int32_t uz_size; /* Size inherited from kegs */ > + > + u_int64_t uz_allocs UMA_ALIGN; /* Total number of allocations */ > + u_int64_t uz_frees; /* Total number of frees */ > + u_int64_t uz_fails; /* Total number of alloc failures */ > uint16_t uz_fills; /* Outstanding bucket fills */ > uint16_t uz_count; /* Highest value ub_ptr can have */ > > @@ -324,7 +330,7 @@ struct uma_zone { > * This HAS to be the last item because we adjust the zone size > * based on NCPU and then allocate the space for the zones. > */ > - struct uma_cache uz_cpu[1]; /* Per cpu caches */ > + struct uma_cache uz_cpu[1] UMA_ALIGN; /* Per cpu caches */ > }; > > /* > @@ -341,6 +347,8 @@ struct uma_zone { > #define UMA_ZFLAG_INHERIT (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | \ > UMA_ZFLAG_BUCKET) > > +#undef UMA_ALIGN > + > #ifdef _KERNEL > /* Internal prototypes */ > static __inline uma_slab_t hash_sfind(struct uma_hash *hash, u_int8_t *data); > -- Bjoern A. Zeeb It will not break if you know what you are doing.