From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754098AbcALUyF (ORCPT ); Tue, 12 Jan 2016 15:54:05 -0500 Received: from mail-ig0-f193.google.com ([209.85.213.193]:35812 "EHLO mail-ig0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbcALUyD (ORCPT ); Tue, 12 Jan 2016 15:54:03 -0500 MIME-Version: 1.0 In-Reply-To: <56956276.1090705@kernel.org> References: <1445975631-17047-1-git-send-email-dave@stgolabs.net> <1445975631-17047-4-git-send-email-dave@stgolabs.net> <20151027223744.GB11242@worktop.amr.corp.intel.com> <20151102201535.GB1707@linux-uzut.site> <20160112150032-mutt-send-email-mst@redhat.com> <56956276.1090705@kernel.org> Date: Tue, 12 Jan 2016 12:54:02 -0800 X-Google-Sender-Auth: pgPJHo4-lwN4qaswKl6R9pRUFnU Message-ID: Subject: Re: [PATCH 3/4] x86,asm: Re-work smp_store_mb() From: Linus Torvalds To: Andy Lutomirski Cc: "Michael S. Tsirkin" , Davidlohr Bueso , Davidlohr Bueso , Peter Zijlstra , "the arch/x86 maintainers" , Linux Kernel Mailing List , virtualization , "H. Peter Anvin" , Thomas Gleixner , "Paul E. McKenney" , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2016 at 12:30 PM, Andy Lutomirski wrote: > > I recall reading somewhere that lock addl $0, 32(%rsp) or so (maybe even 64) > was better because it avoided stomping on very-likely-to-be-hot write > buffers. I suspect it could go either way. You want a small constant (for the isntruction size), but any small constant is likely to be within the current stack frame anyway. I don't think 0(%rsp) is particularly likely to have a spill on it right then and there, but who knows.. And 64(%rsp) is possibly going to be cold in the L1 cache, especially if it's just after a deep function call. Which it might be. So it might work the other way. So my guess would be that you wouldn't be able to measure the difference. It might be there, but probably too small to really see in any noise. But numbers talk, bullshit walks. It would be interesting to be proven wrong. Linus