From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757794AbbDWNpn (ORCPT ); Thu, 23 Apr 2015 09:45:43 -0400 Received: from mail.efficios.com ([78.47.125.74]:38955 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752212AbbDWNpm (ORCPT ); Thu, 23 Apr 2015 09:45:42 -0400 Date: Thu, 23 Apr 2015 13:45:40 +0000 (UTC) From: Mathieu Desnoyers To: Steven Rostedt Cc: Stephen Hemminger , Pranith Kumar , LKML , Josh Triplett , KOSAKI Motohiro , Nicholas Miell , Linus Torvalds , Ingo Molnar , Alan Cox , Lai Jiangshan , Andrew Morton , Thomas Gleixner , Peter Zijlstra , David Howells , Michael Kerrisk Message-ID: <1146370149.34873.1429796740391.JavaMail.zimbra@efficios.com> In-Reply-To: <20150422224850.76064d98@grimm.local.home> References: <1429283202-6245-1-git-send-email-mathieu.desnoyers@efficios.com> <1526056761.34535.1429735242508.JavaMail.zimbra@efficios.com> <20150422174051.5c868437@urahara> <20150422224850.76064d98@grimm.local.home> Subject: Re: [PATCH v16] sys_membarrier(): system-wide memory barrier (generic, x86) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.222.194.238] X-Mailer: Zimbra 8.0.7_GA_6021 (ZimbraWebClient - FF37 (Linux)/8.0.7_GA_6021) Thread-Topic: sys_membarrier(): system-wide memory barrier (generic, x86) Thread-Index: gNXAVkCTd9nMl22LKu45T1uPVTS9Zw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > On Wed, 22 Apr 2015 17:40:51 -0700 > Stephen Hemminger wrote: > > > The syscall should just return 0. > > Let the application not worry about how many CPU's are present > > +1 This is indeed how I implemented it initially. The nice thing about this approach is that if the application don't care much about the overhead of calling sys_membarrier on !SMP, returning 0 tells the application that sys_membarrier is indeed supported, and that the application don't need to issue memory barriers on the other target threads (compiler barrier is then sufficient), which is correct. I'll update the patch accordingly. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com