From: Al Viro <viro@ZenIV.linux.org.uk>
To: Namhyung Kim <namhyung@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/buffer.c: change buffer_busy() to use logical-OR expression
Date: Sat, 23 Oct 2010 18:21:07 +0100 [thread overview]
Message-ID: <20101023172107.GQ19804@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1287853575-14190-1-git-send-email-namhyung@gmail.com>
On Sun, Oct 24, 2010 at 02:06:15AM +0900, Namhyung Kim wrote:
> Convert bitwise-OR operator to logical-OR in favor of short-circuit
> evaluation. The end result would be same.
It'll cost _more_.
Think of it:
v = atomic_read(...)
w = bh->b_state
w &= constant
v |= w
return v
vs.
v = atomic_read()
branch to l if not equal to 0
w = bh->b_state
if w & constant is not 0, branch to l
v = 0
return v
l: v = 1
return v
That short-circuit won't win anything here.
next prev parent reply other threads:[~2010-10-23 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-23 17:06 [PATCH] fs/buffer.c: change buffer_busy() to use logical-OR expression Namhyung Kim
2010-10-23 17:21 ` Al Viro [this message]
2010-10-23 17:49 ` Namhyung Kim
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=20101023172107.GQ19804@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.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).