Re: Why do we use cpu nice priority for ioprio?

From: Jens Axboe
Date: Fri Mar 25 2011 - 03:48:16 EST


On 2011-03-25 03:38, Justin TerAvest wrote:
> It's not clear why the cpu nice value should be mapped to the ioprio
> for a task when none is picked.
>
> Internally, at cfq_init_prio_data(), we just set:
> ioprio = IOPRIO_NORM;
> ioprio_class = IOPRIO_CLASS_BE;
> if ioprio_class is IOPRIO_CLASS_NONE.
>
>
> The problem is that today, SCHED_RR and SCHED_FIFO threads
> automatically get bumped up to RT class. This all happens behind the
> curtains and the io_class of the thread is still shown as NONE with
> sys_ioprio_get(). What's the motivation behind this promotion of
> ioprio class?

It was decided back in the day when io priorities were introduced. I
still think it's a good idea. You could argue that auto-bumping up to
IOPRIO_CLASS_RT is a bit heavy handed. But is it really that different
from the CPU scheduling?

So, from memory, the difference between RR and FIFO on the CPU
scheduling side is that one of them will relingiush the CPU for a brief
period once in a while. Correct? That does not happen for
IOPRIO_CLASS_RT. So at least from that perspective, it's not a complete
match and might be a cause for concern.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/