From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136AbbCQPHy (ORCPT ); Tue, 17 Mar 2015 11:07:54 -0400 Received: from smtprelay0155.hostedemail.com ([216.40.44.155]:41853 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753465AbbCQPHx convert rfc822-to-8bit (ORCPT ); Tue, 17 Mar 2015 11:07:53 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:152:355:379:541:599:800:966:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3872:3873:3874:4385:5007:6261:7875:7903:10004:10400:10848:10967:11026:11232:11658:11914:12043:12438:12517:12519:12740:13069:13311:13357:13972:14096:14097:21080:21088,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: crow97_7ed455791c80d X-Filterd-Recvd-Size: 2519 Date: Tue, 17 Mar 2015 11:07:50 -0400 From: Steven Rostedt To: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= Cc: Christoph Lameter , 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_*() Message-ID: <20150317110750.2a0e2b73@gandalf.local.home> In-Reply-To: <20150317144701.GJ10068@pengutronix.de> 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> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Mar 2015 15:47:01 +0100 Uwe Kleine-König wrote: > Guten Morgen Steven, > > On Tue, Mar 17, 2015 at 10:40:38AM -0400, Steven Rostedt wrote: > > static __always_inline void trace_recursive_unlock(void) > > { > > - unsigned int val = this_cpu_read(current_context); > > + unsigned int val = __this_cpu_read(current_context); > > + unsigned int val2; > > > > - val--; > > - val &= this_cpu_read(current_context); > > - this_cpu_write(current_context, val); > > + val2 = val - 1; > > + val &= val2; > > + __this_cpu_write(current_context, val); > You could use: > > unsigned int val = __this_cpu_read(current_context); > > val = val & (val - 1); > > __this_cpu_write(current_context, val); > > and save a few lines and still make it more readable (IMHO). Me too. My version came from looking at too much assembly, and val2 just happened to be another register in my mind. > > BTW, this patch makes the additional lines in the trace disappear, so if > you think that makes a Tested-by applicable, feel free to add it. OK, will do. Thanks. Christoph, you happy with this version? -- Steve