linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Galbraith <umgwanakikbuti@gmail.com>
To: paul.szabo@sydney.edu.au
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: CFS scheduler unfairly prefers pinned tasks
Date: Thu, 08 Oct 2015 16:25:45 +0200	[thread overview]
Message-ID: <1444314345.3565.78.camel@gmail.com> (raw)
In-Reply-To: <201510081054.t98AsL1U003456@como.maths.usyd.edu.au>

On Thu, 2015-10-08 at 21:54 +1100, paul.szabo@sydney.edu.au wrote:
> Dear Mike,
> 
> > I see a fairness issue ... but one opposite to your complaint.
> 
> Why is that opposite? I think it would be fair for the one pert process
> to get 100% CPU, the many oink processes can get everything else. That
> one oink is lowly 10% (when others are 100%) is of no consequence.

Well, not exactly opposite, only opposite in that the one pert task also
receives MORE than it's fair share when unpinned.  Two 100$ hogs sharing
one CPU should each get 50% of that CPU.  The fact that the oink group
contains 8 tasks vs 1 for the pert group should be irrelevant, but what
that last oinker is getting is 1/9 of a CPU, and there just happen to be
9 runnable tasks total, 1 in group pert, and 8 in group oink.

IFF that ratio were to prove to be a constant, AND the oink group were a
massively parallel and synchronized compute job on a huge box, that
entire compute job would not be slowed down by the factor 2 that a fair
distribution would do to it, on say a 1000 core box, it'd be.. utterly
dead, because you'd put it out of your misery.

vogelweide:~/:[0]# cgexec -g cpu:foo bash
vogelweide:~/:[0]# for i in `seq 0 63`; do taskset -c $i cpuhog& done
[1] 8025
[2] 8026
...
vogelweide:~/:[130]# cgexec -g cpu:bar bash
vogelweide:~/:[130]# taskset -c 63 pert 10 (report every 10 seconds)
2260.91 MHZ CPU
perturbation threshold 0.024 usecs.
pert/s:      255 >2070.76us:       38 min:  0.05 max:4065.46 avg: 93.83 sum/s: 23946us overhead: 2.39%
pert/s:      255 >2070.32us:       37 min:  1.32 max:4039.94 avg: 92.82 sum/s: 23744us overhead: 2.37%
pert/s:      253 >2069.85us:       38 min:  0.05 max:4036.44 avg: 94.89 sum/s: 24054us overhead: 2.41%

Hm, that's a kinda odd looking number from my 64 core box, but whatever,
it's far from fair according to my definition thereof.  Poor little oink
plus all other cycles not spent in pert's tight loop add up ~24ms/s.

> Good to see that you agree on the fairness issue... it MUST be fixed!
> CFS might be wrong or wasteful, but never unfair.

Weeell, we've disagreed on pretty much everything we've talked about so
far, but I can well imagine that what I see in the share update business
_could_ be part of your massive compute job woes.

	-Mike


  parent reply	other threads:[~2015-10-08 14:25 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 21:48 CFS scheduler unfairly prefers pinned tasks paul.szabo
2015-10-06  2:45 ` Mike Galbraith
2015-10-06 10:06   ` paul.szabo
2015-10-06 12:17     ` Mike Galbraith
2015-10-06 20:44       ` paul.szabo
2015-10-07  1:28         ` Mike Galbraith
2015-10-08  8:19   ` Mike Galbraith
2015-10-08 10:54     ` paul.szabo
2015-10-08 11:19       ` Peter Zijlstra
2015-10-10 13:22         ` [patch] sched: disable task group re-weighting on the desktop Mike Galbraith
2015-10-10 14:03           ` kbuild test robot
2015-10-10 14:41             ` Mike Galbraith
2015-10-10 17:01           ` Peter Zijlstra
2015-10-10 17:13             ` Peter Zijlstra
2015-10-11  2:25             ` Mike Galbraith
2015-10-11 17:42               ` 4.3 group scheduling regression Mike Galbraith
2015-10-12  7:23                 ` Peter Zijlstra
2015-10-12  7:44                   ` Mike Galbraith
2015-10-12  8:04                     ` Peter Zijlstra
2015-10-12  0:53                       ` Yuyang Du
2015-10-12  9:12                         ` Peter Zijlstra
2015-10-12  2:12                           ` Yuyang Du
2015-10-12 10:23                             ` Mike Galbraith
2015-10-12 19:55                               ` Yuyang Du
2015-10-13  4:08                                 ` Mike Galbraith
2015-10-12 20:42                                   ` Yuyang Du
2015-10-13  8:06                                 ` Peter Zijlstra
2015-10-13  0:35                                   ` Yuyang Du
2015-10-13  8:10                                   ` Peter Zijlstra
2015-10-13  0:37                                     ` Yuyang Du
2015-10-12 11:47                             ` Peter Zijlstra
2015-10-12 19:32                               ` Yuyang Du
2015-10-13  8:07                                 ` Peter Zijlstra
2015-10-13  2:22                               ` Mike Galbraith
2015-10-12  8:48                       ` Mike Galbraith
2015-10-10 20:14           ` [patch] sched: disable task group re-weighting on the desktop paul.szabo
2015-10-11  2:38             ` Mike Galbraith
2015-10-11  9:25               ` paul.szabo
2015-10-11 12:49                 ` Mike Galbraith
2015-10-11 19:46           ` paul.szabo
2015-10-12  1:59             ` Mike Galbraith
2015-10-08 14:25       ` Mike Galbraith [this message]
2015-10-08 21:55         ` CFS scheduler unfairly prefers pinned tasks paul.szabo
2015-10-09  1:56           ` Mike Galbraith
2015-10-09  2:40           ` Mike Galbraith
2015-10-11  9:43             ` paul.szabo
2015-10-10  3:59     ` Wanpeng Li
2015-10-10  7:58       ` Wanpeng Li
  -- strict thread matches above, loose matches on Subject: below --
2015-10-11 20:59 paul.szabo

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=1444314345.3565.78.camel@gmail.com \
    --to=umgwanakikbuti@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.szabo@sydney.edu.au \
    --cc=peterz@infradead.org \
    /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).