Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754438AbbKCBgg (ORCPT ); Mon, 2 Nov 2015 20:36:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:47755 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbbKCBgf (ORCPT ); Mon, 2 Nov 2015 20:36:35 -0500 Date: Mon, 2 Nov 2015 17:36:25 -0800 From: Davidlohr Bueso To: Linus Torvalds Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , "Paul E. McKenney" , Linux Kernel Mailing List , the arch/x86 maintainers , Davidlohr Bueso Subject: Re: [PATCH 3/4] x86,asm: Re-work smp_store_mb() Message-ID: <20151103013625.GD1707@linux-uzut.site> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 28 On Mon, 02 Nov 2015, Linus Torvalds wrote: >On Mon, Nov 2, 2015 at 12:15 PM, Davidlohr Bueso wrote: >> >> So I ran some experiments on an IvyBridge (2.8GHz) and the cost of XCHG is >> constantly cheaper (by at least half the latency) than MFENCE. While there >> was a decent amount of variation, this difference remained rather constant. > >Mind testing "lock addq $0,0(%rsp)" instead of mfence? That's what we >use on old cpu's without one (ie 32-bit). I'm getting results very close to xchg. >I'm not actually convinced that mfence is necessarily a good idea. I >could easily see it being microcode, for example. Interesting. > >At least on my Haswell, the "lock addq" is pretty much exactly half >the cost of "mfence". Ok, his coincides with my results on IvB. -- 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/