lkml.org 
[lkml]   [2016]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics
Paul Turner, on Mon 19 Dec 2016 14:44:38 -0800, wrote:
> On Mon, Dec 19, 2016 at 2:40 PM, Samuel Thibault
> <samuel.thibault@ens-lyon.org> wrote:
> > 2159197d6677 ("sched/core: Enable increased load resolution on 64-bit kernels")
> >
> > exposed yet another miscalculation in calc_cfs_shares: MIN_SHARES is unscaled,
> > and must thus be scaled before being manipulated against "shares" amounts.
>
> It's actually intentional that MIN_SHARES is un-scaled here, this is
> necessary to support the goal of sub-partitioning groups with small
> shares.

Uh? you mean it's normal that MIN_SHARES is here compared as such
against "shares" while e.g. in sched_group_set_shares or effective_load
it is scaled before comparing with "shares"?

> E.g. A group with shares=2 and 5 threads will internally provide 2048
> units of weight for the load-balancer to account for their
> distribution.

But here "shares" is already scaled, so

> > - if (shares < MIN_SHARES)
> > - shares = MIN_SHARES;
...
> > return shares;

This will only make sure that the returned shares is 2, not 2048.

Samuel

\
 
 \ /
  Last update: 2016-12-20 00:07    [W:0.123 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site