From: yalin wang <yalin.wang2010@gmail.com>
To: axboe@fb.com, snitzer@redhat.com, tj@kernel.org, jack@suse.cz,
shli@fb.com, ross.zwisler@linux.intel.com,
matthew.r.wilcox@intel.com, rafael.j.wysocki@intel.com,
yalin.wang2010@gmail.com, linux-kernel@vger.kernel.org
Subject: [RFC] block: change blk_check_merge_flags() implementation
Date: Fri, 20 Nov 2015 18:55:25 +0800 [thread overview]
Message-ID: <1448016925-16092-1-git-send-email-yalin.wang2010@gmail.com> (raw)
Use XOR to chenk some flags in flags1 and flags2 if the same,
much faster on some platforms.
Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
include/linux/blkdev.h | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c401ecd..3d0f053 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -655,16 +655,7 @@ static inline bool rq_mergeable(struct request *rq)
static inline bool blk_check_merge_flags(unsigned int flags1,
unsigned int flags2)
{
- if ((flags1 & REQ_DISCARD) != (flags2 & REQ_DISCARD))
- return false;
-
- if ((flags1 & REQ_SECURE) != (flags2 & REQ_SECURE))
- return false;
-
- if ((flags1 & REQ_WRITE_SAME) != (flags2 & REQ_WRITE_SAME))
- return false;
-
- return true;
+ return !((flags1 ^ flags2) & (REQ_DISCARD | REQ_SECURE | REQ_WRITE_SAME));
}
static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
--
1.9.1
reply other threads:[~2015-11-20 10:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1448016925-16092-1-git-send-email-yalin.wang2010@gmail.com \
--to=yalin.wang2010@gmail.com \
--cc=axboe@fb.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.r.wilcox@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=ross.zwisler@linux.intel.com \
--cc=shli@fb.com \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®