From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93318 invoked by alias); 7 Jun 2018 13:07:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 93309 invoked by uid 89); 7 Jun 2018 13:07:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_MANYTO,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=30000, tunable X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Cc: nd@arm.com, Dave Hansen , Tim Chen , Andi Kleen , Ying Huang , Aaron Lu , Lu Aubrey Subject: Re: [PATCH v3 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex To: Kemi Wang , Adhemerval Zanella , Florian Weimer , Rical Jason , Carlos Donell , Glibc alpha References: <1527067354-13333-1-git-send-email-kemi.wang@intel.com> From: Szabolcs Nagy Message-ID: <339c2b6d-5175-efff-ca17-a964c15a1b3c@arm.com> Date: Thu, 07 Jun 2018 13:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1527067354-13333-1-git-send-email-kemi.wang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::16) To AM6PR08MB3285.eurprd08.prod.outlook.com (2603:10a6:209:47::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-TrafficTypeDiagnostic: AM6PR08MB3285: NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Forefront-PRVS: 06968FD8C4 Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Office365-Filtering-Correlation-Id: 65f10619-5184-4387-8dc1-08d5cc778e23 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2018 13:06:58.8654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65f10619-5184-4387-8dc1-08d5cc778e23 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3285 X-SW-Source: 2018-06/txt/msg00137.txt.bz2 On 23/05/18 10:22, Kemi Wang wrote: > This patch does not have any functionality change, we only provide a spin > count tunes for pthread adaptive spin mutex. The tunable > glibc.mutex.spin_count tunes can be used by system administrator to squeeze > system performance according to different hardware capabilities and > workload characteristics. > > The maximum value of spin count is limited to 30000 to avoid the overflow > of mutex->__data.__spins variable with the possible type of short in > pthread_mutex_lock (). > > The default value of spin count is set to 100 with the reference to the > previous number of times of spinning via trylock. This value would be > architecture-specific and can be tuned with kinds of benchmarks to fit most > cases in future. > i'm not against this tunable, but do ppl use PTHREAD_MUTEX_ADAPTIVE_NP in practice? it's a non-standard extension, if the normal mutex is not good enough that should be fixed (e.g. it should do some spinning on SMP systems if that's useful in general, the futex syscall overhead is way bigger than a few atomic loads).