Re: [PATCH -next 1/8] block, bfq: cleanup bfq_weights_tree add/remove apis

From: Jan Kara
Date: Thu May 19 2022 - 06:59:51 EST


On Sat 14-05-22 17:05:15, Yu Kuai wrote:
> They already pass 'bfqd' as the first parameter, there is no need to
> pass 'bfqd->queue_weights_tree' as another parameter.
>
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>

Looks good. Just one nit below:

> @@ -945,12 +945,13 @@ void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> * about overhead.
> */
> void __bfq_weights_tree_remove(struct bfq_data *bfqd,
> - struct bfq_queue *bfqq,
> - struct rb_root_cached *root)
> + struct bfq_queue *bfqq)
> {
> + struct rb_root_cached *root;

Add empty line here please.

> if (!bfqq->weight_counter)
> return;
>
> + root = &bfqd->queue_weights_tree;
> bfqq->weight_counter->num_active--;
> if (bfqq->weight_counter->num_active > 0)
> goto reset_entity_pointer;

Otherwise the patch looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Honza

--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR