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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ce2b34c.1639ea.18436352501.Coremail.nickyc975@zju.edu.cn>
Date:   Wed, 2 Nov 2022 10:39:23 +0800 (GMT+08:00)
From:   "Jinlong Chen" <nickyc975@....edu.cn>
To:     "Jens Axboe" <axboe@...nel.dk>
Cc:     "Christoph Hellwig" <hch@....de>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: Re: [PATCH 4/4] blk-mq: improve readability of
 blk_mq_alloc_request()




> -----原始邮件-----
> 发件人: "Jens Axboe" <axboe@...nel.dk>
> 发送时间: 2022-11-02 10:25:27 (星期三)
> 收件人: "Jinlong Chen" <nickyc975@....edu.cn>, "Christoph Hellwig" <hch@....de>
> 抄送: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
> 主题: Re: [PATCH 4/4] blk-mq: improve readability of blk_mq_alloc_request()
> 
> On 11/1/22 8:19 PM, Jinlong Chen wrote:
> >> On Tue, Nov 01, 2022 at 11:11:37PM +0800, Jinlong Chen wrote:
> >>> Add a helper blk_mq_alloc_request_nocache() to alloc request without
> >>> cache. This makes blk_mq_alloc_request() more readable.
> >>>
> >>> Signed-off-by: Jinlong Chen <nickyc975@....edu.cn>
> >>> ---
> >>>  block/blk-mq.c | 47 +++++++++++++++++++++++++++++------------------
> >>>  1 file changed, 29 insertions(+), 18 deletions(-)
> >>>
> >>> diff --git a/block/blk-mq.c b/block/blk-mq.c
> >>> index 87a6348a0d0a..2fae111a42c8 100644
> >>> --- a/block/blk-mq.c
> >>> +++ b/block/blk-mq.c
> >>> @@ -572,36 +572,47 @@ static struct request *blk_mq_alloc_cached_request(struct request_queue *q,
> >>>  	return rq;
> >>>  }
> >>>  
> >>> +static struct request *blk_mq_alloc_request_nocache(struct request_queue *q,
> >>> +		blk_opf_t opf, blk_mq_req_flags_t flags)
> >>
> >> The name is a bit odd, but I can't think off a better one.
> >>
> >>> +	struct blk_mq_alloc_data data = {
> >>>  			.q		= q,
> >>>  			.flags		= flags,
> >>>  			.cmd_flags	= opf,
> >>>  			.nr_tags	= 1,
> >>>  		};
> >>
> >> And this now has superflous indenation.  Overall, while the separate
> >> helper looks marginally nicer, I'm not really sure it is worth the
> >> churn.
> > 
> > I'll drop the patch if you think it is not worth the churn. But I
> > started doing this because of the following goto statement:
> 
> Please just drop it, I don't think it's an improvement.

Ok, then I'll just resend patch 2 without the silly goto return NULL and
patch 3.

Thanks!
Jinlong Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ