Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753018AbaKQUwU (ORCPT ); Mon, 17 Nov 2014 15:52:20 -0500 Received: from mail-vc0-f177.google.com ([209.85.220.177]:33880 "EHLO mail-vc0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbaKQUwS (ORCPT ); Mon, 17 Nov 2014 15:52:18 -0500 MIME-Version: 1.0 In-Reply-To: <20141117171812.22333.90395.stgit@ahduyck-server> References: <20141117171005.22333.96544.stgit@ahduyck-server> <20141117171812.22333.90395.stgit@ahduyck-server> Date: Mon, 17 Nov 2014 12:52:17 -0800 X-Google-Sender-Auth: 9Ta-KcKkfYJHVgKCCev2MlLE3Qw Message-ID: Subject: Re: [PATCH 2/4] arch: Add lightweight memory barriers fast_rmb() and fast_wmb() From: Linus Torvalds To: Alexander Duyck Cc: "linux-arch@vger.kernel.org" , Network Development , Linux Kernel Mailing List , Mathieu Desnoyers , Peter Zijlstra , Benjamin Herrenschmidt , Heiko Carstens , Ingo Molnar , Michael Neuling , Russell King - ARM Linux , donald.c.skidmore@intel.com, matthew.vick@intel.com, Geert Uytterhoeven , Jeff Kirsher , Francois Romieu , Paul McKenney , nic_swsd@realtek.com, Will Deacon , Michael Ellerman , Tony Luck , Oleg Nesterov , Martin Schwidefsky , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , David Miller 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 Mon, Nov 17, 2014 at 9:18 AM, Alexander Duyck wrote: > There are a number of situations where the mandatory barriers rmb() and > wmb() are used to order memory/memory operations in the device drivers > and those barriers are much heavier than they actually need to be. Ugh. I absolutely despise the name. It's not "fast". It's just limited. It's the same as "smp_*mb()", in that it works on cacheable memory, but it actually stays around even for non-SMP builds. So I think the name is actively misleading. Naming should be about what it does, not about some kind of PR thing that confuses people into thinking it's "better". Maybe "dma_*mb()" would be acceptable, and ends up having the same naming convention as "smb_*mb()", and explains what it's about. And yes, in the same spirit, it would probably be good to try to eventually get rid of the plain "*mb()" functions, and perhaps call them "mmio_*mb()" to clarify that they are about ordering memory wrt mmio. Hmm? 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/