From owner-freebsd-arch@FreeBSD.ORG Wed May 20 16:28:25 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 478E3F3F; Wed, 20 May 2015 16:28:25 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14E121FED; Wed, 20 May 2015 16:28:25 +0000 (UTC) Received: by igbpi8 with SMTP id pi8so106863545igb.1; Wed, 20 May 2015 09:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=vGknbsLFhoIWTytJ0ju/8RQvjYAVTtqhOX7I55ad2O8=; b=gBee1G6D84l3g8ppruw9h3S5YJRRiQcuYyoR3pfpuYuovzrtZUJ/NuTwZ4N4WrCvNL +lzIr5CNzVAub61MtX5pwkT8bC6gEPI9gm9yVEfAMfMT0lqeiWLgXMr3BEoHL7ZSN3Is ZYtQJXGTzT6UEs4hwf077CqhhhFCM2WStbJuOGibO4Xa021WYM6x6fDdO9leniAy0Kcj SQUZPAWoFsYQMxiUiS9yYKm3WYOhjrKym8uFsOBLRd6SX7mYgIOhdB1uo7S5rt6Wivf4 8o6YLyFzzUMpOYb8mfqKY80FJJSHxtAny3HQOqAJf1985aJlBLGSII+6vAXjBao42LJk okWA== MIME-Version: 1.0 X-Received: by 10.43.163.129 with SMTP id mo1mr46067270icc.61.1432139304456; Wed, 20 May 2015 09:28:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Wed, 20 May 2015 09:28:24 -0700 (PDT) Date: Wed, 20 May 2015 09:28:24 -0700 X-Google-Sender-Auth: heknrg_gRX8vsFxF9vYZyv8DXNw Message-ID: Subject: RFC: make UMTX hash table size configurable From: Adrian Chadd To: "freebsd-arch@freebsd.org" , "freebsd-embedded@freebsd.org" Content-Type: text/plain; charset=UTF-8 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:28:25 -0000 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