[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62c9b68f-6adc-41d8-b504-4bce4d721e64@acm.org>
Date: Thu, 28 Aug 2025 21:38:24 -0700
From: Bart Van Assche <bvanassche@....org>
To: chengkaitao <pilgrimtao@...il.com>, axboe@...nel.dk
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
chengkaitao <chengkaitao@...inos.cn>
Subject: Re: [PATCH] block/mq-deadline: Replace DD_PRIO_MAX with DD_PRIO_COUNT
On 8/28/25 6:54 PM, chengkaitao wrote:
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index b9b7cdf1d3c9..1a031922c447 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -41,19 +41,16 @@ static const int fifo_batch = 16; /* # of sequential requests treated as o
> enum dd_data_dir {
> DD_READ = READ,
> DD_WRITE = WRITE,
> + DD_DIR_COUNT = 2
> };
>
> -enum { DD_DIR_COUNT = 2 };
> -
This change is not an improvement in my opinion because it makes it
less clear what the role of DD_DIR_COUNT is.
> enum dd_prio {
> - DD_RT_PRIO = 0,
> - DD_BE_PRIO = 1,
> - DD_IDLE_PRIO = 2,
> - DD_PRIO_MAX = 2,
> + DD_RT_PRIO,
> + DD_BE_PRIO,
> + DD_IDLE_PRIO,
There is code that depends on DD_RT_PRIO < DD_BE_PRIO < DD_IDLE_PRIO so
I'd like to keep the explicit enum values.
> + DD_PRIO_COUNT
> };
>
> -enum { DD_PRIO_COUNT = 3 };
I see the above change as a step backwards because it makes the role of
DD_PRIO_COUNT less clear.
> - for (prio = DD_BE_PRIO; prio <= DD_PRIO_MAX; prio++) {
> + for (prio = DD_BE_PRIO; prio < DD_PRIO_COUNT; prio++) {
The current code is easier to read IMHO than the new code.
Thanks,
Bart.
Powered by blists - more mailing lists