From owner-freebsd-arch@FreeBSD.ORG Wed May 20 16:57:44 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3317D33A; Wed, 20 May 2015 16:57:44 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC011447; Wed, 20 May 2015 16:57:43 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t4KGvcN7002926 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 May 2015 19:57:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t4KGvcN7002926 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t4KGvcws002925; Wed, 20 May 2015 19:57:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 May 2015 19:57:38 +0300 From: Konstantin Belousov To: Eric van Gyzen Cc: Adrian Chadd , "freebsd-arch@freebsd.org" , "freebsd-embedded@freebsd.org" Subject: Re: RFC: make UMTX hash table size configurable Message-ID: <20150520165738.GL2499@kib.kiev.ua> References: <555CB7F7.5070409@vangyzen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <555CB7F7.5070409@vangyzen.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 16:57:44 -0000 On Wed, May 20, 2015 at 12:36:07PM -0400, Eric van Gyzen wrote: > Adrian, > > Good idea. Looks good to me. > > Eric > > On 05/20/2015 12:28, Adrian Chadd wrote: > > Hi, > > > > This patch makes the umtx hash table size configurable. It saves ~40k > > of footprint from embedded images. > > > > (I can't seem to get phabricator to create a diff based on a set of > > files, rather than the whole tree. Sigh.) > > > > adrian@lucy-11i386:~/work/freebsd/head-embedded/src % svn diff > > sys/kern/ sys/conf/options > > Index: sys/kern/kern_umtx.c > > =================================================================== > > --- sys/kern/kern_umtx.c (revision 282934) > > +++ sys/kern/kern_umtx.c (working copy) > > @@ -29,7 +29,7 @@ > > __FBSDID("$FreeBSD$"); > > > > #include "opt_compat.h" > > -#include "opt_umtx_profiling.h" > > +#include "opt_umtx.h" > > > > #include > > #include > > @@ -184,7 +184,11 @@ > > PRI_MAX_TIMESHARE : (td)->td_user_pri) > > > > #define GOLDEN_RATIO_PRIME 2654404609U > > +#ifdef UMTX_NUM_CHAINS > > +#define UMTX_CHAINS UMTX_NUM_CHAINS > > +#else > > #define UMTX_CHAINS 512 > > +#endif /* UMTX_NUM_CHAINS */ > > #define UMTX_SHIFTS (__WORD_BIT - 9) > > > > #define GET_SHARE(flags) \ > > Index: sys/conf/options > > =================================================================== > > --- sys/conf/options (revision 282934) > > +++ sys/conf/options (working copy) > > @@ -209,7 +209,8 @@ > > SYSVSHM opt_sysvipc.h > > SW_WATCHDOG opt_watchdog.h > > TURNSTILE_PROFILING > > -UMTX_PROFILING > > +UMTX_PROFILING opt_umtx.h > > +UMTX_NUM_CHAINS opt_umtx.h > > VFS_AIO > > VERBOSE_SYSINIT > > WLCACHE opt_wavelan.h It makes more sense to make the hash size a tunable. The hash mask would also need to be a variable.