linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: Shaohua Li <shli@fb.com>, <linux-block@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <axboe@fb.com>,
	<Kernel-team@fb.com>
Subject: Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled
Date: Tue, 10 May 2016 19:33:45 -0400	[thread overview]
Message-ID: <20160510193345.6243a503@gandalf.local.home> (raw)
In-Reply-To: <x49a8jx7vww.fsf@segfault.boston.devel.redhat.com>

On Tue, 10 May 2016 11:52:15 -0400
Jeff Moyer <jmoyer@redhat.com> 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 <testbool>:
   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

  reply	other threads:[~2016-05-10 23:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  0:22 [PATCH 1/3] blktrace: delete garbage for message trace Shaohua Li
2016-05-10  0:22 ` [PATCH 2/3] blktrace: add missed mask name Shaohua Li
2016-05-10 15:45   ` Jeff Moyer
2016-05-10  0:22 ` [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Shaohua Li
2016-05-10  5:46   ` Simon Guo
2016-05-11 16:54     ` Shaohua Li
2016-05-10 15:52   ` Jeff Moyer
2016-05-10 23:33     ` Steven Rostedt [this message]
2016-05-11 13:47       ` Jeff Moyer
2016-05-11  0:20     ` Shaohua Li
2016-05-11 13:41       ` Jeff Moyer
2016-05-11 16:49         ` Shaohua Li
2016-05-10 14:31 ` [PATCH 1/3] blktrace: delete garbage for message trace Jeff Moyer
2016-05-10 14:46 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160510193345.6243a503@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shli@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).