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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221014145004.gqqpa5uvgg576tej@quack3>
Date:   Fri, 14 Oct 2022 16:50:04 +0200
From:   Jan Kara <jack@...e.cz>
To:     Yuwei Guan <ssawgyw@...il.com>
Cc:     paolo.valente@...aro.org, axboe@...nel.dk, jack@...e.cz,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yuwei.Guan@...krlife.com
Subject: Re: [PATCH] bfq: do try insert merge before bfq_init_rq() call

On Thu 13-10-22 21:53:21, Yuwei Guan wrote:
> It's useless to do bfq_init_rq(rq), if the rq can do merge first.
> 
> In the patch 5f550ede5edf8, it moved to bfq_init_rq() before
> blk_mq_sched_try_insert_merge(), but it's pointless,
> as the fifo_time of next is not set yet,
> and !list_empty(&next->queuelist) is 0, so it does not
> need to reposition rq's fifo_time.
> 
> And for the "hash lookup, try again" situation, as follow,
> bfq_requests_merged() call can work normally.
> 
> blk_mq_sched_try_insert_merge
>   elv_attempt_insert_merge
>     elv_rqhash_find
> 
> Signed-off-by: Yuwei Guan <Yuwei.Guan@...krlife.com>

OK, after some thinking I agree. How much testing has this patch got?
Because I'd like to verify we didn't overlook something.

							Honza

> ---
>  block/bfq-iosched.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 7ea427817f7f..9845370a701c 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -6147,7 +6147,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  		bfqg_stats_update_legacy_io(q, rq);
>  #endif
>  	spin_lock_irq(&bfqd->lock);
> -	bfqq = bfq_init_rq(rq);
> +
>  	if (blk_mq_sched_try_insert_merge(q, rq, &free)) {
>  		spin_unlock_irq(&bfqd->lock);
>  		blk_mq_free_requests(&free);
> @@ -6156,6 +6156,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  
>  	trace_block_rq_insert(rq);
>  
> +	bfqq = bfq_init_rq(rq);
>  	if (!bfqq || at_head) {
>  		if (at_head)
>  			list_add(&rq->queuelist, &bfqd->dispatch);
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ