From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753608AbbCSQdd (ORCPT ); Thu, 19 Mar 2015 12:33:33 -0400 Received: from resqmta-ch2-04v.sys.comcast.net ([69.252.207.36]:45617 "EHLO resqmta-ch2-04v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbbCSQdb (ORCPT ); Thu, 19 Mar 2015 12:33:31 -0400 Date: Thu, 19 Mar 2015 11:33:30 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Steven Rostedt cc: =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= , LKML , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, Russell King Subject: Re: [PATCH v2] ring-buffer: Replace this_cpu_*() with __this_cpu_*() In-Reply-To: Message-ID: References: <20150316173154.537b80ee@gandalf.local.home> <20150317081341.0f9a8b4c@gandalf.local.home> <20150317101113.32f5618a@gandalf.local.home> <20150317104038.312e73d1@gandalf.local.home> <20150317144701.GJ10068@pengutronix.de> <20150317110750.2a0e2b73@gandalf.local.home> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If you are redoing it then please get the comments a bit cleared up. The heaviness of the fallback version of this_cpu_read/write can usually easily be remedied by arch specific definitions. The per cpu offset is somewhere in a register and one needs to define a macro that creates an instruction that does a fetch from that register plus the current offset into the area that is needed. This is similarly easy for the write path. But then its often easier to just use the __this_cpu instructions since preemption is often off in these code paths. I have had code for IA64 in the past that does this.