From: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
To: Yu Kuai <yukuai1-XF6JlduFytWkHkcT6e4Xnw@public.gmane.org>
Cc: jack-AlSwsSmVLrQ@public.gmane.org,
axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
paolo.valente-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
yi.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH -next 3/3] block, bfq: remove useless parameter for bfq_add/del_bfqq_busy()
Date: Wed, 17 Aug 2022 13:56:04 +0200 [thread overview]
Message-ID: <20220817115604.llq3rx2pdf64ii2w@quack3> (raw)
In-Reply-To: <20220816015631.1323948-4-yukuai1-XF6JlduFytWkHkcT6e4Xnw@public.gmane.org>
On Tue 16-08-22 09:56:31, Yu Kuai wrote:
> From: Yu Kuai <yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>
> 'bfqd' can be accessed through 'bfqq->bfqd', there is no need to pass
> it as a parameter separately.
>
> Signed-off-by: Yu Kuai <yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
I agree. That also seemed a bit strange to me in bfq code. Feel free to
add:
Reviewed-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
Honza
> ---
> block/bfq-iosched.c | 8 ++++----
> block/bfq-iosched.h | 5 ++---
> block/bfq-wf2q.c | 9 ++++++---
> 3 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index f39067389b2b..7ea427817f7f 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -1925,7 +1925,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd,
> bfqq->service_from_backlogged = 0;
> bfq_clear_bfqq_softrt_update(bfqq);
>
> - bfq_add_bfqq_busy(bfqd, bfqq);
> + bfq_add_bfqq_busy(bfqq);
>
> /*
> * Expire in-service queue if preemption may be needed for
> @@ -2419,7 +2419,7 @@ static void bfq_remove_request(struct request_queue *q,
> bfqq->next_rq = NULL;
>
> if (bfq_bfqq_busy(bfqq) && bfqq != bfqd->in_service_queue) {
> - bfq_del_bfqq_busy(bfqd, bfqq, false);
> + bfq_del_bfqq_busy(bfqq, false);
> /*
> * bfqq emptied. In normal operation, when
> * bfqq is empty, bfqq->entity.service and
> @@ -3098,7 +3098,7 @@ void bfq_release_process_ref(struct bfq_data *bfqd, struct bfq_queue *bfqq)
> */
> if (bfq_bfqq_busy(bfqq) && RB_EMPTY_ROOT(&bfqq->sort_list) &&
> bfqq != bfqd->in_service_queue)
> - bfq_del_bfqq_busy(bfqd, bfqq, false);
> + bfq_del_bfqq_busy(bfqq, false);
>
> bfq_reassign_last_bfqq(bfqq, NULL);
>
> @@ -3908,7 +3908,7 @@ static bool __bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> */
> bfqq->budget_timeout = jiffies;
>
> - bfq_del_bfqq_busy(bfqd, bfqq, true);
> + bfq_del_bfqq_busy(bfqq, true);
> } else {
> bfq_requeue_bfqq(bfqd, bfqq, true);
> /*
> diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
> index f81ab3c8fa3c..64ee618064ba 100644
> --- a/block/bfq-iosched.h
> +++ b/block/bfq-iosched.h
> @@ -1080,9 +1080,8 @@ void bfq_deactivate_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> void bfq_activate_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq);
> void bfq_requeue_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> bool expiration);
> -void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> - bool expiration);
> -void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq);
> +void bfq_del_bfqq_busy(struct bfq_queue *bfqq, bool expiration);
> +void bfq_add_bfqq_busy(struct bfq_queue *bfqq);
>
> /* --------------- end of interface of B-WF2Q+ ---------------- */
>
> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
> index 983413cdefad..8fc3da4c23bb 100644
> --- a/block/bfq-wf2q.c
> +++ b/block/bfq-wf2q.c
> @@ -1651,9 +1651,10 @@ void bfq_requeue_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> * the service tree. As a special case, it can be invoked during an
> * expiration.
> */
> -void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> - bool expiration)
> +void bfq_del_bfqq_busy(struct bfq_queue *bfqq, bool expiration)
> {
> + struct bfq_data *bfqd = bfqq->bfqd;
> +
> bfq_log_bfqq(bfqd, bfqq, "del from busy");
>
> bfq_clear_bfqq_busy(bfqq);
> @@ -1674,8 +1675,10 @@ void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> /*
> * Called when an inactive queue receives a new request.
> */
> -void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq)
> +void bfq_add_bfqq_busy(struct bfq_queue *bfqq)
> {
> + struct bfq_data *bfqd = bfqq->bfqd;
> +
> bfq_log_bfqq(bfqd, bfqq, "add to busy");
>
> bfq_activate_bfqq(bfqd, bfqq);
> --
> 2.31.1
>
--
Jan Kara <jack-IBi9RG/b67k@public.gmane.org>
SUSE Labs, CR
next prev parent reply other threads:[~2022-08-17 11:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-16 1:56 [PATCH -next 0/3] bfq simple cleanups Yu Kuai
2022-08-16 1:56 ` [PATCH -next 1/3] block, bfq: remove unused functions Yu Kuai
[not found] ` <20220816015631.1323948-2-yukuai1-XF6JlduFytWkHkcT6e4Xnw@public.gmane.org>
2022-08-17 11:55 ` Jan Kara
2022-08-16 1:56 ` [PATCH -next 2/3] block, bfq: remove useless checking in bfq_put_queue() Yu Kuai
2022-08-17 11:54 ` Jan Kara
2022-08-16 1:56 ` [PATCH -next 3/3] block, bfq: remove useless parameter for bfq_add/del_bfqq_busy() Yu Kuai
[not found] ` <20220816015631.1323948-4-yukuai1-XF6JlduFytWkHkcT6e4Xnw@public.gmane.org>
2022-08-17 11:56 ` Jan Kara [this message]
2022-08-19 20:56 ` [PATCH -next 0/3] bfq simple cleanups Jens Axboe
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=20220817115604.llq3rx2pdf64ii2w@quack3 \
--to=jack-alswssmvlrq@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=paolo.valente-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=yi.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=yukuai1-XF6JlduFytWkHkcT6e4Xnw@public.gmane.org \
--cc=yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
/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