Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ionice priority "none: prio 0" v. "none: prio 1" v. best-effort v. idle?

149 views
Skip to first unread message

Linda Walsh

unread,
Jun 4, 2009, 11:32:24 PM6/4/09
to LKML
<-- vim: se sts=4 sw=4 ts=8 nosi sc ai: /--> I was looking at the output
of ionice on the various processes
running.

Other than one I set for 'best-effort' (-c2), the rest all had
priorities of
1) "none: prio 0"
OR
2) "none: prio 4"

Out of 183 process:

79 had "none: prio 0" and
103 had "none: prio 4"
(1 had "best effort, prio 4").

Where does priority class 'none' fit in? above or below 'idle'?

Or is 'none' equal to 'best effort' (which is logical in once sense, but
strictly, I could argue 'none' is at least below 'best effort', and possibly
below idle, as 'idle' at least has been assigned a scheduling priority
(vs. processes that have not -- BUT, but definition, idle is clearly meant
to be lower precedence, so that would argue, logically, that 'none' is
above idle and below 'best_effort' (since processes with no assigned
priority would logically be below those assigned as 'best effort'.

Within 'besteffort', 0=high, and 7=low.

Is the same true in 'none', or are the values 'meaningless'?
(In which case, why do they all exist at either 4 or 0?)

Since the iopriority DOES NOT correlate with either
the cpu priority nor 'nice' value, then how are different
processes assigned different priority values?

They *seem* to be mostly fixed, but very rarely I'll see maybe
1 process toggle from 0 to 4 or back (but its usually fixed).

So why is everything in the 'none' class at either "highest level" (prio
0), OR the mid level of prio=4? Um...found exception on a 32-bit i386
based kernel, all prio's are "none: prio 0". But two different x86_64 bit
kernels have "a split", majority in none:prio 4, and a minority of
25-44% in 'none:prio 4'.

I'm using the cfq scheduler on all 3 machines.

So what is it with 'schedclass'=none? Is it lower than 'best effort'?
(I'd hope so, or like to see it that way, but wants are nice...:-))...

If they *ARE* the same, why are 44% running at highest priority
(regardless of cpu prio, 'nice' value, user-id, and the rest at 'mid')?

Why so random, but worse, why put any at 'highest' (unless they
ask for it). Wouldn't 'mid' priority be consistent with 'mid-cpu-nice'
value of 0 (out of +/-19)?

FWIW -- I thought once the priorities varied dynamically based on
cpu-nice levels (for cfq, anyway)...it would be VERY nice to see that
reflected in the readable ionice data for those processes.

Thanks for clarification/enlightenment...
Linda

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

Corrado Zoccolo

unread,
Jun 5, 2009, 10:13:11 AM6/5/09
to Linda Walsh, LKML
Hi Linda,
the ioprio class 'none' is the default class in which all processes
are put when created, if not specified otherwise (this is in contrast
with what I read in the man page, where it says Best Effort is the
default).
For CFQ (other io schedulers just ignore it), the 'none' class has a
special meaning, in fact, looking at:
http://git.kernel.org/?p=linux/kernel/git/aegl/linux-2.6.git;a=blob;f=block/cfq-iosched.c;h=a55a9bd75bd1baf616a3a1b7118acaeee328759f;hb=HEAD#l1579
you will see that for processes with class 'none', the class and
priority will be inherited from CPU scheduling (including RT
scheduling & nice levels).

HTH,
Corrado

--
__________________________________________________________________________

dott. Corrado Zoccolo mailto:czoc...@gmail.com
PhD - Department of Computer Science - University of Pisa, Italy
--------------------------------------------------------------------------
The self-confidence of a warrior is not the self-confidence of the average
man. The average man seeks certainty in the eyes of the onlooker and calls
that self-confidence. The warrior seeks impeccability in his own eyes and
calls that humbleness.
Tales of Power - C. Castaneda

Corrado Zoccolo

unread,
Jun 6, 2009, 11:43:31 AM6/6/09
to Linda Walsh, LKML
Hi Linda,

On Fri, Jun 5, 2009 at 11:52 PM, Linda Walsh<lk...@tlinx.org> wrote:
> <-- vim: se sts=4 sw=4 ts=8 nosi sc ai: /-->

> Thanks for the pointer to the exact C-file for the cfg scheduler, but
> if you intended the 'line' tag to mean anything, line#1579
> would be 38 lines beyond the end of the 1541 line file.

Hhm, which version are you looking at?
cfq-iosched.c is 2676 lines long in my 2.6.30-rc8, and I'm pointing to
function cfq_init_prio_data.
It may be that in your older version, this code is not yet present, or
has a different form.

What I see here:

static void cfq_init_prio_data(struct cfq_queue *cfqq, struct io_context *ioc)
{
struct task_struct *tsk = current;
int ioprio_class;

if (!cfq_cfqq_prio_changed(cfqq))
return;

ioprio_class = IOPRIO_PRIO_CLASS(ioc->ioprio);
switch (ioprio_class) {
default:
printk(KERN_ERR "cfq: bad prio %x\n", ioprio_class);
case IOPRIO_CLASS_NONE:
/*
* no prio set, inherit CPU scheduling settings
*/
cfqq->ioprio = task_nice_ioprio(tsk);
cfqq->ioprio_class = task_nice_ioclass(tsk);
break;
case IOPRIO_CLASS_RT:
cfqq->ioprio = task_ioprio(ioc);
cfqq->ioprio_class = IOPRIO_CLASS_RT;
break;
case IOPRIO_CLASS_BE:
cfqq->ioprio = task_ioprio(ioc);
cfqq->ioprio_class = IOPRIO_CLASS_BE;
break;
case IOPRIO_CLASS_IDLE:
cfqq->ioprio_class = IOPRIO_CLASS_IDLE;
cfqq->ioprio = 7;
cfq_clear_cfqq_idle_window(cfqq);
break;
}
..

The case IOPRIO_CLASS_NONE is the interesting one, since it uses
task_nice_* functions (defined in include/linux/ioprio.h) to inherit
the cpu scheduler priorities.
The rest of the code can assume that IOPRIO_CLASS_NONE will not
appear, since it was already translated to meaningful values.

<snip>
> This would seem to indicate a fundamental error in cfq's io
> scheduling.
>

As I see the code on 2.6.30, cfq is implementing it correctly, but
differently from what is stated in the man page (that, in turn,
matches what you are seeing from an earlier version of it).

> If the above is not the case -- this is the BEST example of why
> I would like "ionice" to return the actual dynamic "io-priority"
> of a process -- IF, it is set by CPU priority, AND would like it
> to be clear where the "cpu-governed priority" class
> (currently labeled 'none', but ideally would be renamed something
> like 'follow-cpu'?) maybe should be renamed 'follow-cpu'?) is
> in relation to the the other named classes (idle,be,rt).
>
It would be nice, but almost impossible to do. The fact is that the
ioprio acquires a meaning only in combination with an io-scheduler.
Different io-schedulers could, in theory, interpret the none class in
different ways (it is not even mentioned in the man). And a process
that is doing I/O on 2 disks could be talking with 2 different
io-schedulers at the same time. 'ionice' cannot therefore give a
single dynamic priority, and it is much easier to have it just display
the values of the fields, instead of their interpretation.

Corrado

>
> So just how confused am I, or,
>
> Is there a problem with the code (as it appears in this module)?
>
> Tnx,
> Linda

0 new messages