From: Bob Liu <bob.liu@oracle.com>
To: Dmitry Fomichev <dmitry.fomichev@wdc.com>,
linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Subject: Re: [PATCH] block: streamline merge possibility checks
Date: Thu, 19 Dec 2019 16:56:54 +0800 [thread overview]
Message-ID: <c76929ea-2fcb-bbd3-a394-5d42f619191e@oracle.com> (raw)
In-Reply-To: <20191218194156.29430-1-dmitry.fomichev@wdc.com>
On 12/19/19 3:41 AM, Dmitry Fomichev wrote:
> Checks for data direction in attempt_merge() and blk_rq_merge_ok()
> are redundant and will always succeed when the both I/O request
> operations are equal. Therefore, remove them.
>
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> ---
> block/blk-merge.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index d783bdc4559b..796451aed7d6 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -745,8 +745,7 @@ static struct request *attempt_merge(struct request_queue *q,
> if (req_op(req) != req_op(next))
> return NULL;
>
> - if (rq_data_dir(req) != rq_data_dir(next)
> - || req->rq_disk != next->rq_disk)
> + if (req->rq_disk != next->rq_disk)
> return NULL;
>
> if (req_op(req) == REQ_OP_WRITE_SAME &&
> @@ -868,10 +867,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
> if (req_op(rq) != bio_op(bio))
> return false;
>
> - /* different data direction or already started, don't merge */
> - if (bio_data_dir(bio) != rq_data_dir(rq))
> - return false;
> -
Reviewed-by: Bob Liu <bob.liu@oracle.com>
> /* must be same device */
> if (rq->rq_disk != bio->bi_disk)
> return false;
>
next prev parent reply other threads:[~2019-12-19 8:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 19:41 [PATCH] block: streamline merge possibility checks Dmitry Fomichev
2019-12-19 8:56 ` Bob Liu [this message]
2019-12-19 10:05 ` Damien Le Moal
2019-12-20 6:50 ` Bob Liu
2020-01-08 13:44 ` Christoph Hellwig
2020-01-08 22:02 ` Dmitry Fomichev
2020-01-09 0:56 ` Bob Liu
2020-01-08 13:41 ` Christoph Hellwig
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=c76929ea-2fcb-bbd3-a394-5d42f619191e@oracle.com \
--to=bob.liu@oracle.com \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=dmitry.fomichev@wdc.com \
--cc=linux-block@vger.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;
as well as URLs for NNTP newsgroup(s).