From: Tianxianting <tian.xianting@h3c.com>
To: Jens Axboe <axboe@kernel.dk>, "ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"kafai@fb.com" <kafai@fb.com>,
"songliubraving@fb.com" <songliubraving@fb.com>,
"yhs@fb.com" <yhs@fb.com>, "andriin@fb.com" <andriin@fb.com>,
"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
"kpsingh@chromium.org" <kpsingh@chromium.org>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: RE: [PATCH] block: remove redundant empty check of mq_list
Date: Thu, 10 Sep 2020 09:44:56 +0000 [thread overview]
Message-ID: <d0b4d3e984d2499d9c2f28834a21e9ae@h3c.com> (raw)
In-Reply-To: <466b8c40-9d53-8a40-6c5b-f76db2974c04@kernel.dk>
Hi Jens,
Thanks for your feedback,
Yes, blk_flush_plug_list() is only caller of blk_mq_flush_plug_list().
So I checked the callers of blk_flush_plug_list(), found below code path will call blk_flush_plug_list():
io_schedule_prepare/sched_submit_work->blk_schedule_flush_plug
writeback_sb_inodes->blk_flush_plug
blk_finish_plug
dm_submit_bio/__submit_bio_noacct_mq/__submit_bio->blk_mq_submit_bio
blk_poll
So I think there are still many chances to do the redundant judge?
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, September 09, 2020 10:21 PM
To: tianxianting (RD) <tian.xianting@h3c.com>; ast@kernel.org; daniel@iogearbox.net; kafai@fb.com; songliubraving@fb.com; yhs@fb.com; andriin@fb.com; john.fastabend@gmail.com; kpsingh@chromium.org
Cc: linux-block@vger.kernel.org; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; bpf@vger.kernel.org
Subject: Re: [PATCH] block: remove redundant empty check of mq_list
On 9/9/20 12:48 AM, Xianting Tian wrote:
> blk_mq_flush_plug_list() itself will do the empty check of mq_list, so
> remove such check in blk_flush_plug_list().
> Actually normally mq_list is not empty when blk_flush_plug_list is
> called.
It's cheaper to do in the caller, instead of doing the function call and then aborting if it's empty. So I'd suggest just leaving it alone.
Right now this is the only caller, but it's nicer to assume we can be called in any state vs not having the check.
--
Jens Axboe
prev parent reply other threads:[~2020-09-10 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 6:48 Xianting Tian
2020-09-09 14:21 ` Jens Axboe
2020-09-10 9:44 ` Tianxianting [this message]
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=d0b4d3e984d2499d9c2f28834a21e9ae@h3c.com \
--to=tian.xianting@h3c.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@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
all inboxes | Powered by JetHome®