From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337Ab3KYU6P (ORCPT ); Mon, 25 Nov 2013 15:58:15 -0500 Received: from www.linutronix.de ([62.245.132.108]:57359 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269Ab3KYU6N (ORCPT ); Mon, 25 Nov 2013 15:58:13 -0500 Message-Id: <20131125203358.156292370@linutronix.de> User-Agent: quilt/0.60-1 Date: Mon, 25 Nov 2013 20:58:08 -0000 From: Thomas Gleixner To: LKML Cc: Davidlohr Bueso , Jason Low , Ingo Molnar , Darren Hart , Peter Zijlstra , Mike Galbraith , Jeff Mahoney , Linus Torvalds , Scott Norton , Tom Vaden , Aswin Chandramouleeswaran , Waiman Long , "Paul E. McKenney" Subject: [RFC patch 0/5] futex: Allow lockless empty check of hashbucket plist in futex_wake() 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 The patch set from Davidlohr [1] tried to attempt the same via an atomic counter of waiters in a hash bucket. The atomic counter access provided enough serialization for x86 so that a failure is not observable in testing, but does not provide any guarantees. The same can be achieved with a smp_mb() pair including proper guarantees for all architectures. The following series provides an incremental approach to this and adds documentation of the ordering guarantees of futexes. Note, this is RFC and needs a lot of review, testing and proper performance numbers for the following scenarios: 1) Test case where a single waiter is about to queue itself, i.e. the test case Davidlohr used to gather his numbers. 2) Test case where the hash bucket is always not empty. This allows us to determine the smp_mb() overhead for cases which are not optimized by the singler waiter per bucket. These tests need to be done on x86 AND on other architectures where the smp_mb() might be more expensive than on x86. Thanks, tglx --- [1] http://lkml.kernel.org/r/1385168197-8612-5-git-send-email-davidlohr@hp.com