Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756874AbbDPJTf (ORCPT ); Thu, 16 Apr 2015 05:19:35 -0400 Received: from www.linutronix.de ([62.245.132.108]:43197 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbbDPJTZ (ORCPT ); Thu, 16 Apr 2015 05:19:25 -0400 Date: Thu, 16 Apr 2015 11:19:41 +0200 (CEST) From: Thomas Gleixner To: Davidlohr Bueso cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Darren Hart , Steven Rostedt , fredrik.markstrom@windriver.com, Manfred Spraul , Arnaldo Carvalho de Melo Subject: Re: [PATCH 2/3 v2] futex: avoid double wake up in futex_wake() on -RT In-Reply-To: <1429160982.6795.35.camel@stgolabs.net> Message-ID: References: <1428419030-20030-1-git-send-email-bigeasy@linutronix.de> <1428419030-20030-3-git-send-email-bigeasy@linutronix.de> <20150410161135.GF3057@linutronix.de> <1428894155.16668.6.camel@stgolabs.net> <1429160982.6795.35.camel@stgolabs.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1748 Lines: 46 On Wed, 15 Apr 2015, Davidlohr Bueso wrote: > On Sun, 2015-04-12 at 20:02 -0700, Davidlohr Bueso wrote: > > Doing the wakeups while holding the lock is also a general performance > > issue for futex_wake. The problem being dealing with spurious wakeups > > (wacky drivers), which makes no difference wrt nr_wake. > > So I did some measurements with the patch below (Cc'ing Arnaldo for > perf-bench consideration, albeit probably still pretty crude) and by > doing the lockless wakeups, on avg we reduce contending waking threads > latency in about 2x for each thread, which indicates that overall > speedup is based on the number of futex_wake'ers. > > I guess now we have the code, the numbers. I go back to auditing drivers > *sigh*. In any case any important core-code already deals with spurious > wakeups (the last silly offender being sysv sems), so I'm really not > _that_ concerned -- in fact, Peter, your patch to trigger them seems to > not trigger any issues anymore. But perhaps its late and I'm in lala > land. OTOH, we have quite some other code in the kernel which can generate spurious wakeups. Just look at signals. CPU0 CPU1 T1 random_syscall() schedule_interruptible() Send process wide signal, wake T1 because its the first target T2 do_stuff() handle_signal() schedule() T1 Deal with the spurious wakeup So any code which does not handle a spurious wakeup is broken independent of the futex changes. So really nothing to worry about. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/