public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Yu Zhao <yuzhao@google.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zhaoyang Huang <huangzhaoyang@gmail.com>,
	steve.kang@unisoc.com
Subject: Re: [PATCH 3/3] block: introducing a bias over deadline's fifo_time
Date: Thu, 8 Feb 2024 10:49:51 -0700	[thread overview]
Message-ID: <ca00ff75-e98d-4652-9c52-94b2e876901e@kernel.dk> (raw)
In-Reply-To: <20240208093136.178797-3-zhaoyang.huang@unisoc.com>

On 2/8/24 2:31 AM, zhaoyang.huang wrote:
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index f958e79277b8..43c08c3d6f18 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -15,6 +15,7 @@
>  #include <linux/compiler.h>
>  #include <linux/rbtree.h>
>  #include <linux/sbitmap.h>
> +#include "../kernel/sched/sched.h"
>  
>  #include <trace/events/block.h>
>  
> @@ -802,6 +803,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  	u8 ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
>  	struct dd_per_prio *per_prio;
>  	enum dd_prio prio;
> +	int fifo_expire;
>  
>  	lockdep_assert_held(&dd->lock);
>  
> @@ -840,7 +842,9 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  		/*
>  		 * set expire time and add to fifo list
>  		 */
> -		rq->fifo_time = jiffies + dd->fifo_expire[data_dir];
> +		fifo_expire = task_is_realtime(current) ? dd->fifo_expire[data_dir] :
> +			CFS_PROPORTION(current, dd->fifo_expire[data_dir]);
> +		rq->fifo_time = jiffies + fifo_expire;
>  		insert_before = &per_prio->fifo_list[data_dir];
>  #ifdef CONFIG_BLK_DEV_ZONED
>  		/*

Hard pass on this blatant layering violation. Just like the priority
changes, this utterly fails to understand how things are properly
designed.

-- 
Jens Axboe


  parent reply	other threads:[~2024-02-08 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  9:31 [PATCH 1/3] sched: fix compiling error on kernel/sched/sched.h zhaoyang.huang
2024-02-08  9:31 ` [PATCH 2/3] sched: introduce a macro for getting approximat CFS part of a timing value zhaoyang.huang
2024-02-08  9:31 ` [PATCH 3/3] block: introducing a bias over deadline's fifo_time zhaoyang.huang
2024-02-08 17:46   ` Bart Van Assche
2024-02-08 23:52     ` Zhaoyang Huang
2024-02-08 17:49   ` Jens Axboe [this message]
2024-02-09  0:02     ` Zhaoyang Huang
2024-02-09  0:10       ` Jens Axboe
2024-02-09  0:28         ` Zhaoyang Huang
2024-02-09  1:58           ` Damien Le Moal
2024-02-09  3:08             ` Zhaoyang Huang

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=ca00ff75-e98d-4652-9c52-94b2e876901e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=huangzhaoyang@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=steve.kang@unisoc.com \
    --cc=vincent.guittot@linaro.org \
    --cc=yuzhao@google.com \
    --cc=zhaoyang.huang@unisoc.com \
    /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