Re: Question about group scheduler cpu shares

From: Mike Galbraith
Date: Fri Jul 22 2016 - 00:19:24 EST


On Thu, 2016-07-21 at 20:24 -0700, Gaurav Poothia wrote:

(top posting.. naught naughty;)

> 1.What is the function that translates from various nice levels to
> weight i.e. nice(0) == 1024 how to translate for other levels

If you rummage around in kernel/sched, you'll find this table:

const int sched_prio_to_weight[40] = {
/* -20 */ 88761, 71755, 56483, 46273, 36291,
/* -15 */ 29154, 23254, 18705, 14949, 11916,
/* -10 */ 9548, 7620, 6100, 4904, 3906,
/* -5 */ 3121, 2501, 1991, 1586, 1277,
/* 0 */ 1024, 820, 655, 526, 423,
/* 5 */ 335, 272, 215, 172, 137,
/* 10 */ 110, 87, 70, 56, 45,
/* 15 */ 36, 29, 23, 18, 15,
};

> 2.How does that work when an interior node has multiple tasks? So if I
> added tasks E and F with difference nice levels to Group 1 task list
> how would the math work?

The math works the same as if you were adding task groups. An entity
is an entity is an entity...

-Mike