Message ID | 20210806111857.488705-5-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | IO priority fixes and improvements | expand |
On 8/6/21 5:18 AM, Damien Le Moal wrote: > diff --git a/include/uapi/linux/ioprio.h b/include/uapi/linux/ioprio.h > index 99d37d4807b8..5b4a39c2f623 100644 > --- a/include/uapi/linux/ioprio.h > +++ b/include/uapi/linux/ioprio.h > @@ -42,8 +42,8 @@ enum { > }; > > /* > - * Fallback BE priority > + * Fallback BE priority level. > */ > -#define IOPRIO_NORM 4 > +#define IOPRIO_BE_NORM 4 This again seems like a very poor idea.
On 2021/08/08 1:19, Jens Axboe wrote: > On 8/6/21 5:18 AM, Damien Le Moal wrote: >> diff --git a/include/uapi/linux/ioprio.h b/include/uapi/linux/ioprio.h >> index 99d37d4807b8..5b4a39c2f623 100644 >> --- a/include/uapi/linux/ioprio.h >> +++ b/include/uapi/linux/ioprio.h >> @@ -42,8 +42,8 @@ enum { >> }; >> >> /* >> - * Fallback BE priority >> + * Fallback BE priority level. >> */ >> -#define IOPRIO_NORM 4 >> +#define IOPRIO_BE_NORM 4 > > This again seems like a very poor idea. OK. Will remove that. Or we could do: #define IOPRIO_NORM 4 #define IOPRIO_BE_NORM IOPRIO_NORM In case other classes want to set a different default... Though, that is not critical I think.
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index d5824cab34d7..a07d630c6972 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5408,7 +5408,7 @@ static struct bfq_queue **bfq_async_queue_prio(struct bfq_data *bfqd, case IOPRIO_CLASS_RT: return &bfqg->async_bfqq[0][ioprio]; case IOPRIO_CLASS_NONE: - ioprio = IOPRIO_NORM; + ioprio = IOPRIO_BE_NORM; fallthrough; case IOPRIO_CLASS_BE: return &bfqg->async_bfqq[1][ioprio]; diff --git a/block/ioprio.c b/block/ioprio.c index ca6b136c5586..0e4ff245f2bf 100644 --- a/block/ioprio.c +++ b/block/ioprio.c @@ -170,7 +170,7 @@ static int get_task_ioprio(struct task_struct *p) ret = security_task_getioprio(p); if (ret) goto out; - ret = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, IOPRIO_NORM); + ret = IOPRIO_DEFAULT; task_lock(p); if (p->io_context) ret = p->io_context->ioprio; @@ -182,9 +182,9 @@ static int get_task_ioprio(struct task_struct *p) int ioprio_best(unsigned short aprio, unsigned short bprio) { if (!ioprio_valid(aprio)) - aprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM); + aprio = IOPRIO_DEFAULT; if (!ioprio_valid(bprio)) - bprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM); + bprio = IOPRIO_DEFAULT; return min(aprio, bprio); } diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index e9d9ad47f70f..0fbbff0b3edb 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -662,7 +662,7 @@ static struct request *nvme_nvm_alloc_request(struct request_queue *q, if (rqd->bio) blk_rq_append_bio(rq, rqd->bio); else - rq->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_NORM); + rq->ioprio = IOPRIO_DEFAULT; return rq; } diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 9b3a6d8172b4..2837c3a0d2e1 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h @@ -8,6 +8,11 @@ #include <uapi/linux/ioprio.h> +/* + * Default IO priority. + */ +#define IOPRIO_DEFAULT IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NORM) + /* * Check that a priority value has a valid class. */ @@ -50,7 +55,7 @@ static inline int get_current_ioprio(void) if (ioc) return ioc->ioprio; - return IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0); + return IOPRIO_DEFAULT; } /* diff --git a/include/uapi/linux/ioprio.h b/include/uapi/linux/ioprio.h index 99d37d4807b8..5b4a39c2f623 100644 --- a/include/uapi/linux/ioprio.h +++ b/include/uapi/linux/ioprio.h @@ -42,8 +42,8 @@ enum { }; /* - * Fallback BE priority + * Fallback BE priority level. */ -#define IOPRIO_NORM 4 +#define IOPRIO_BE_NORM 4 #endif /* _UAPI_LINUX_IOPRIO_H */