Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755546Ab3H2QnK (ORCPT ); Thu, 29 Aug 2013 12:43:10 -0400 Received: from mail-vc0-f171.google.com ([209.85.220.171]:52556 "EHLO mail-vc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753613Ab3H2QnI (ORCPT ); Thu, 29 Aug 2013 12:43:08 -0400 MIME-Version: 1.0 In-Reply-To: <20130829070012.GC27322@gmail.com> References: <1375758759-29629-1-git-send-email-Waiman.Long@hp.com> <1375758759-29629-2-git-send-email-Waiman.Long@hp.com> <1377751465.4028.20.camel@pasglop> <20130829070012.GC27322@gmail.com> Date: Thu, 29 Aug 2013 09:43:07 -0700 X-Google-Sender-Auth: nQCytZfcTM1tUKZiLsxdtWbrBMA Message-ID: Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount From: Linus Torvalds To: Ingo Molnar Cc: Benjamin Herrenschmidt , Waiman Long , Alexander Viro , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 26 On Thu, Aug 29, 2013 at 12:00 AM, Ingo Molnar wrote: > > Lockrefs are combiend spinlock+count objects that fit into a > MESI-cacheline and can be accessed via the cmpxchg8b() primitives and > allow smart combined operations on the count field without necessarily > taking the lock. Side note: I'm going to finally build a new desktop, and made sure that I got a CPU that supports TSX. I'm not convinced transactional memory ends up being usable in general without hardware support for predicting transaction success, but using transactions to do small specialized things like this may well be worth it. Especially since the cmpxchg approach has some issues. We'll see. The real problem is that I'm not sure if I can even see the scalability issue on any machine I actually personally want to use (read: silent). On my current system I can only get up to 15% _raw_spin_lock by just stat'ing the same file over and over and over again from lots of threads. Linus -- 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/