From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753031AbcEJXdu (ORCPT ); Tue, 10 May 2016 19:33:50 -0400 Received: from smtprelay0188.hostedemail.com ([216.40.44.188]:35169 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752439AbcEJXds (ORCPT ); Tue, 10 May 2016 19:33:48 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2197:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3653:3865:3867:3868:3871:3872:3874:4321:4605:5007:6119:6261:7875:7903:7904:9121:10004:10400:10848:10967:11026:11232:11233:11473:11658:11914:12043:12296:12438:12517:12519:12555:12679:12740:13069:13161:13229:13311:13357:13439:14096:14097:14181:14581:14659:14721:21080:21221:21433:21434,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,LFtime:18,LUA_SUMMARY:none X-HE-Tag: noise95_20f5c9d58ab40 X-Filterd-Recvd-Size: 2212 Date: Tue, 10 May 2016 19:33:45 -0400 From: Steven Rostedt To: Jeff Moyer Cc: Shaohua Li , , , , Subject: Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Message-ID: <20160510193345.6243a503@gandalf.local.home> In-Reply-To: References: <2c3ee532132f8925dd0be1178e8dee0bba6b448c.1462838969.git.shli@fb.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 May 2016 11:52:15 -0400 Jeff Moyer wrote: > > +static inline bool blk_trace_note_message_enabled(struct request_queue *q) > > +{ > > + struct blk_trace *bt = q->blk_trace; > > + if (likely(!bt)) > > + return false; > > + return bt->act_mask & BLK_TC_NOTIFY; > > Do we want to return !!(bt->act_mask & BLK_TC_NOTIFY)? The return type is bool. I would think that gcc would be smart enough to make the conversion. To check, I compiled the following function: bool testbool(int x) { return x & 1<<3; } and the result was: 0000000000000000 : 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 89 7d fc mov %edi,-0x4(%rbp) 7: 8b 45 fc mov -0x4(%rbp),%eax a: 83 e0 08 and $0x8,%eax d: 85 c0 test %eax,%eax f: 0f 95 c0 setne %al 12: 5d pop %rbp 13: c3 retq I get the same by adding !!(x & 1<<3) Looks like it does the conversion. -- Steve