linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
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: Wed, 11 May 2016 09:47:09 -0400	[thread overview]
Message-ID: <x4960ukogf6.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20160510193345.6243a503@gandalf.local.home> (Steven Rostedt's message of "Tue, 10 May 2016 19:33:45 -0400")

Steven Rostedt <rostedt@goodmis.org> writes:

>> 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.

Cool, thanks!

-Jeff

  reply	other threads:[~2016-05-11 13:47 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
2016-05-11 13:47       ` Jeff Moyer [this message]
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=x4960ukogf6.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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).