Re: Question about sched_prio_to_weight values

From: Francesco Poli
Date: Thu Oct 10 2019 - 19:03:01 EST


On Thu, 10 Oct 2019 18:28:36 +0100 Valentin Schneider wrote:

> On 07/10/2019 21:41, Francesco Poli wrote:
> > The differences are probably due to the different precision
> > of the computations: I don't know the precision of those originally
> > carried out by Ingo Molnar (single precision? double?), but calc(1)
> > is an arbitrary precision calculator and, by default, performs
> > calculations with epsilon = 1e-20 !
> >
> > Please note that, except for the first one, all the differing
> > values obtained with the calc(1) script have slightly better
> > errors than the ones found in kernel/sched/core.c ...
> >
>
> As always patches are welcome, but I don't know how much there is to gain
> from a tiny error correction in those factors.

I can of course prepare a patch (a trivial adjustment of some of those
numbers), if there's interest about it, but I'll leave to you kernel
hackers to decide whether the modification may be worth doing (I am no
scheduler expert, I don't even know exactly how to test the scheduler
and assess whether a given patch is beneficial or not)...

>
> Out of curiosity, what led you to stare at those numbers?

While reading a chapter of a book on operating systems, I encountered
the nice-level-to-weight mapping, as defined in the CFS: I became
obsessively curious and wanted by any means to understand how those
numbers were decided. That's why I was trying to reproduce them with
some criterion which could make sense.


--
http://www.inventati.org/frx/
There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
GnuPG key fpr == CA01 1147 9CD2 EFDF FB82 3925 3E1C 27E1 1F69 BFFE

Attachment: pgpNXkj__C7iv.pgp
Description: PGP signature