From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757571AbcIVUlR (ORCPT ); Thu, 22 Sep 2016 16:41:17 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:39312 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754140AbcIVUlO (ORCPT ); Thu, 22 Sep 2016 16:41:14 -0400 Date: Thu, 22 Sep 2016 22:38:41 +0200 (CEST) From: Thomas Gleixner To: Waiman Long cc: Davidlohr Bueso , Peter Zijlstra , Mike Galbraith , Ingo Molnar , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Jason Low , Scott J Norton , Douglas Hatch Subject: Re: [RFC PATCH v2 3/5] futex: Throughput-optimized (TO) futexes In-Reply-To: <57E43EF9.8000400@hpe.com> Message-ID: References: <1474378963-15496-1-git-send-email-Waiman.Long@hpe.com> <1474378963-15496-4-git-send-email-Waiman.Long@hpe.com> <1474441172.27308.19.camel@gmail.com> <57E319BE.2050208@hpe.com> <20160922074932.GV5008@twins.programming.kicks-ass.net> <20160922144123.GB13358@linux-80c1.suse> <20160922151144.GC13358@linux-80c1.suse> <57E43A46.9080601@hpe.com> <57E43EF9.8000400@hpe.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Sep 2016, Waiman Long wrote: > BTW, my initial attempt for the new futex was to use the same workflow as the > PI futexes, but use mutex which has optimistic spinning instead of rt_mutex. > That version can double the throughput compared with PI futexes but still far > short of what can be achieved with wait-wake futex. Looking at the performance > figures from the patch: > > wait-wake futex PI futex TO futex > --------------- -------- -------- > max time 3.49s 50.91s 2.65s > min time 3.24s 50.84s 0.07s > average time 3.41s 50.90s 1.84s > sys time 7m22.4s 55.73s 2m32.9s That's really interesting. Do you have any explanation for this massive system time differences? > lock count 3,090,294 9,999,813 698,318 > unlock count 3,268,896 9,999,814 134 > > The problem with a PI futexes like version is that almost all the lock/unlock > operations were done in the kernel which added overhead and latency. Now > looking at the numbers for the TO futexes, less than 1/10 of the lock > operations were done in the kernel, the number of unlock was insignificant. > Locking was done mostly by lock stealing. This is where most of the > performance benefit comes from, not optimistic spinning. How does the lock latency distribution of all this look like and how fair is the whole thing? > This is also the reason that a lock handoff mechanism is implemented to > prevent lock starvation which is likely to happen without one. Where is that lock handoff mechanism? Thanks, tglx