From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753533Ab3BHAD6 (ORCPT ); Thu, 7 Feb 2013 19:03:58 -0500 Received: from mail-da0-f49.google.com ([209.85.210.49]:54784 "EHLO mail-da0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268Ab3BHAD5 (ORCPT ); Thu, 7 Feb 2013 19:03:57 -0500 Message-ID: <1360281834.28557.73.camel@edumazet-glaptop> Subject: Re: [RFC PATCH 1/6] kernel: implement queue spinlock API From: Eric Dumazet To: Michel Lespinasse Cc: paulmck@linux.vnet.ibm.com, Rik van Riel , Ingo Molnar , David Howells , Thomas Gleixner , Eric Dumazet , "Eric W. Biederman" , Manfred Spraul , linux-kernel@vger.kernel.org, john.stultz@linaro.org Date: Thu, 07 Feb 2013 16:03:54 -0800 In-Reply-To: References: <1358896415-28569-1-git-send-email-walken@google.com> <1358896415-28569-2-git-send-email-walken@google.com> <20130207223434.GG2545@linux.vnet.ibm.com> <1360277809.28557.60.camel@edumazet-glaptop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2013-02-07 at 15:58 -0800, Michel Lespinasse wrote: > No, I think that's doable. The trick would be that once a thread > acquires the lock, the only remaining use of the node is to receive > the 'next' pointer if/when another thread starts contending for the > lock. So if the lock state would need to distinguish between a lock > that is currently locked but not contended (the next value would then > be NULL), and a lock that is currently locked and contended (the > lock->next value is the node that goes after the current lock owner) > It adds yet another memory write to store the node pointer in the lock... I suspect it's going to increase false sharing.