lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d0b4d3e984d2499d9c2f28834a21e9ae@h3c.com>
Date:   Thu, 10 Sep 2020 09:44:56 +0000
From:   Tianxianting <tian.xianting@....com>
To:     Jens Axboe <axboe@...nel.dk>, "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "kafai@...com" <kafai@...com>,
        "songliubraving@...com" <songliubraving@...com>,
        "yhs@...com" <yhs@...com>, "andriin@...com" <andriin@...com>,
        "john.fastabend@...il.com" <john.fastabend@...il.com>,
        "kpsingh@...omium.org" <kpsingh@...omium.org>
CC:     "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: RE: [PATCH] block: remove redundant empty check of mq_list

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@...nel.dk] 
Sent: Wednesday, September 09, 2020 10:21 PM
To: tianxianting (RD) <tian.xianting@....com>; ast@...nel.org; daniel@...earbox.net; kafai@...com; songliubraving@...com; yhs@...com; andriin@...com; john.fastabend@...il.com; kpsingh@...omium.org
Cc: linux-block@...r.kernel.org; linux-kernel@...r.kernel.org; netdev@...r.kernel.org; bpf@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ