提交 f7eda402 编写于 作者: J Jan Kara 提交者: Jens Axboe

block: Return effective IO priority from get_current_ioprio()

get_current_ioprio() is used to initialize IO priority of various
requests. As such it should be returning the effective IO priority of
the task (i.e., reflecting the fact that unset IO priority should get
set based on task's CPU priority) so that the conversion is concentrated
in one place.
Reviewed-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: NJan Kara <jack@suse.cz>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220623074840.5960-2-jack@suse.czSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 e589f464
无相关合并请求
......@@ -53,10 +53,17 @@ static inline int task_nice_ioclass(struct task_struct *task)
static inline int get_current_ioprio(void)
{
struct io_context *ioc = current->io_context;
int prio;
if (ioc)
return ioc->ioprio;
return IOPRIO_DEFAULT;
prio = ioc->ioprio;
else
prio = IOPRIO_DEFAULT;
if (IOPRIO_PRIO_CLASS(prio) == IOPRIO_CLASS_NONE)
prio = IOPRIO_PRIO_VALUE(task_nice_ioclass(current),
task_nice_ioprio(current));
return prio;
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部