From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbbC3Moe (ORCPT ); Mon, 30 Mar 2015 08:44:34 -0400 Received: from resqmta-ch2-05v.sys.comcast.net ([69.252.207.37]:54357 "EHLO resqmta-ch2-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752428AbbC3Moc (ORCPT ); Mon, 30 Mar 2015 08:44:32 -0400 Date: Mon, 30 Mar 2015 07:44:30 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Steven Rostedt cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , stable@vger.kernel.org, Uwe Kleine-Koenig Subject: Re: [for-next][PATCH 1/4] ring-buffer: Replace this_cpu_*() with __this_cpu_*() In-Reply-To: <20150327161133.505d4074@gandalf.local.home> Message-ID: References: <20150325130011.709478161@goodmis.org> <20150325130037.896265791@goodmis.org> <20150327161133.505d4074@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 On Fri, 27 Mar 2015, Steven Rostedt wrote: > Where in the patch do you see the comment? Or were you talking about > the change log? The original patch did have a comment, an it was > dropped, that's what I thought you were talking about. Sorry yes the changelog. > Actually, it is equivalent, but I do see a issue with my patch. > > val &= val & (val - 1); > > is the same as the more reasonable: > > val &= val - 1; > > I think I meant to replace &= with = :-/ > > > > > or more compact > > > > unsigned int val = __this_cpu_read(current_context); > > > > __this_cpu_write(current_context, val & (val - 1)); > > Maybe I'll just use your compact version. Hmmm... It could even be more compact __this_cpu_and(current_context, __this_cpu_read(current_context) - 1);