From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Paul Turner <pjt@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics
Date: Tue, 20 Dec 2016 00:45:25 +0100 [thread overview]
Message-ID: <20161219234525.GI2895@var.home> (raw)
In-Reply-To: <CAPM31R+ZkKQn1Sej8Q1kvEuLhcp-bFn7CVTKQ2ZrxfXGjC-tjw@mail.gmail.com>
Paul Turner, on Mon 19 Dec 2016 15:32:15 -0800, wrote:
> On Mon, Dec 19, 2016 at 3:29 PM, Samuel Thibault
> <samuel.thibault@ens-lyon.org> wrote:
> > Paul Turner, on Mon 19 Dec 2016 15:26:19 -0800, wrote:
> >> >> > - if (shares < MIN_SHARES)
> >> >> > - shares = MIN_SHARES;
> >> > ...
> >> >> > return shares;
> >> >
> >> > This will only make sure that the returned shares is 2, not 2048.
> >>
> >> This is intentional. The MIN_SHARES you are seeing here is overloaded.
> >> Every "1" unit of share is "SCHED_LOAD_RESOLUTION" bits internally.
> >
> > I'm not talking about the SCHED_LOAD_RESOLUTION scaling, but about the
> > SCHED_FIXEDPOINT_SHIFT scaling, which is what
> > 2159197d6677 ("sched/core: Enable increased load resolution on 64-bit kernels")
> > modified on 64bit platforms.
>
> .... From that commit:
>
> """
> -#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power
> usage under light load */
> +#ifdef CONFIG_64BIT
> # define SCHED_LOAD_RESOLUTION 10
> # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
> # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)
Errgl, sorry, I was referring to the old naming. This stuff has seen
so much patching over and over in the past revisions... It though you
were referring to SCHED_CAPACITY_SCALE. The code I was reading now uses
SCHED_LOAD_RESOLUTION, so that's why I read your "SCHED_LOAD_RESOLUTION"
as "the other scaling".
> The MIN_SHARES you are seeing here is overloaded.
> In the unscaled case this needs to be MIN_SHARES, and in the scaled
> case, the subdivision of the scaled values must still be >=2.
Ok, now I understand. I have to say this overloading is confusing.
Samuel
next prev parent reply other threads:[~2016-12-19 23:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 22:40 [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics Samuel Thibault
2016-12-19 22:44 ` Paul Turner
2016-12-19 23:07 ` Samuel Thibault
2016-12-19 23:26 ` Paul Turner
2016-12-19 23:29 ` Samuel Thibault
2016-12-19 23:32 ` Paul Turner
2016-12-19 23:45 ` Samuel Thibault [this message]
2016-12-20 13:04 ` Dietmar Eggemann
2016-12-20 13:15 ` Peter Zijlstra
2017-01-11 11:29 ` Dietmar Eggemann
2017-01-14 12:48 ` [tip:sched/core] sched/fair: Explain why MIN_SHARES isn't scaled in calc_cfs_shares() tip-bot for Dietmar Eggemann
2016-12-20 13:22 ` [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161219234525.GI2895@var.home \
--to=samuel.thibault@ens-lyon.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pjt@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).