Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbbKBUPr (ORCPT ); Mon, 2 Nov 2015 15:15:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:60443 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbbKBUPo (ORCPT ); Mon, 2 Nov 2015 15:15:44 -0500 Date: Mon, 2 Nov 2015 12:15:35 -0800 From: Davidlohr Bueso To: Peter Zijlstra Cc: Linus Torvalds , 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: <20151102201535.GB1707@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20151027223744.GB11242@worktop.amr.corp.intel.com> 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: 1402 Lines: 33 On Tue, 27 Oct 2015, Peter Zijlstra wrote: >On Wed, Oct 28, 2015 at 06:33:56AM +0900, Linus Torvalds wrote: >> On Wed, Oct 28, 2015 at 4:53 AM, Davidlohr Bueso wrote: >> > >> > Note that this might affect callers that could/would rely on the >> > atomicity semantics, but there are no guarantees of that for >> > smp_store_mb() mentioned anywhere, plus most archs use this anyway. >> > Thus we continue to be consistent with the memory-barriers.txt file, >> > and more importantly, maintain the semantics of the smp_ nature. >> > >> So with this patch, the whole thing becomes pointless, I feel. (Ok, so >> it may have been pointless before too, but at least before this patch >> it generated special code, now it doesn't). So why carry it along at >> all? > >So I suppose this boils down to if: XCHG ends up being cheaper than >MOV+FENCE. 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. Then again, I'm not sure this matters. Thoughts? Thanks, Davidlohr -- 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/