public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] CFS scheduler, -v12
Date: Fri, 18 May 2007 23:11:54 +1000	[thread overview]
Message-ID: <464DA61A.4040406@bigpond.net.au> (raw)
In-Reply-To: <20070518071325.GB28702@elte.hu>

Ingo Molnar wrote:
> * Peter Williams <pwil3058@bigpond.net.au> wrote:
> 
>> I've now done this test on a number of kernels: 2.6.21 and 2.6.22-rc1 
>> with and without CFS; and the problem is always present.  It's not 
>> "nice" related as the all four tasks are run at nice == 0.
> 
> could you try -v13 and did this behavior get better in any way?

It's still there but I've got a theory about what the problems is that 
is supported by some other tests I've done.

What I'd forgotten is that I had gkrellm running as well as top (to 
observe which CPU tasks were on) at the same time as the spinners were 
running.  This meant that between them top, gkrellm and X were using 
about 2% of the CPU -- not much but enough to make it possible that at 
least one of them was running when the load balancer was trying to do 
its thing.

This raises two possibilities: 1. the system looked balanced and 2. the 
system didn't look balanced but one of  top, gkrellm or X was moved 
instead of one of the spinners.

If it's 1 then there's not much we can do about it except say that it 
only happens in these strange circumstances.  If it's 2 then we may have 
to modify the way move_tasks() selects which tasks to move (if we think 
that the circumstances warrant it -- I'm not sure that this is the case).

To examine these possibilities I tried two variations of the test.

a. run the spinners at nice == -10 instead of nice == 0.  When I did 
this the load balancing was perfect on 10 consecutive runs which 
according to my calculations makes it 99.9999997 certain that this 
didn't happen by chance.  This supports theory 2 above.

b. run the tests without gkrellm running but use nice == 0 for the 
spinners.  When I did this the load balancing was mostly perfect but was 
quite volatile (switching between a 2/2 and 1/3 allocation of spinners 
to CPUs) but the %CPU allocation was quite good with the spinners all 
getting approximately 49% of a CPU each.  This also supports theory 2 
above and gives weak support to theory 1 above.

This leaves the question of what to do about it.  Given that most CPU 
intensive tasks on a real system probably only run for a few tens of 
milliseconds it probably won't matter much on a real system except that 
a malicious user could exploit it to disrupt a system.

So my opinion is that we probably do need to do something about it but 
that it's not urgent.

One thing that might work is to jitter the load balancing interval a 
bit.  The reason I say this is that one of the characteristics of top 
and gkrellm is that they run at a more or less constant interval (and, 
in this case, X would also be following this pattern as it's doing 
screen updates for top and gkrellm) and this means that it's possible 
for the load balancing interval to synchronize with their intervals 
which in turn causes the observed problem.  A jittered load balancing 
interval should break the synchronization.  This would certainly be 
simpler than trying to change the move_task() logic for selecting which 
tasks to move.

What do you think?
Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

  parent reply	other threads:[~2007-05-18 13:12 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-13 15:38 [patch] CFS scheduler, -v12 Ingo Molnar
2007-05-16  2:04 ` Peter Williams
2007-05-16  8:08   ` Ingo Molnar
2007-05-16 23:42     ` Peter Williams
     [not found]   ` <20070516063625.GA9058@elte.hu>
2007-05-17 23:45     ` Peter Williams
     [not found]       ` <20070518071325.GB28702@elte.hu>
2007-05-18 13:11         ` Peter Williams [this message]
2007-05-18 13:26           ` Peter Williams
2007-05-19 13:27           ` Dmitry Adamushko
2007-05-20  1:41             ` Peter Williams
2007-05-21  8:29             ` William Lee Irwin III
2007-05-21  8:57               ` Ingo Molnar
2007-05-21 12:08                 ` William Lee Irwin III
2007-05-22 16:48                 ` Chris Friesen
2007-05-22 20:15                   ` Ingo Molnar
2007-05-22 20:49                     ` Chris Friesen
2007-05-21 15:25           ` Dmitry Adamushko
2007-05-21 23:51             ` Peter Williams
2007-05-22  4:47               ` Peter Williams
2007-05-22 12:03                 ` Peter Williams
2007-05-24  7:43                   ` Peter Williams
2007-05-24 16:45                     ` Siddha, Suresh B
2007-05-24 23:23                       ` Peter Williams
2007-05-29 20:45                         ` Siddha, Suresh B
2007-05-29 23:54                           ` Peter Williams
2007-05-30  0:50                             ` Siddha, Suresh B
2007-05-30  2:18                               ` Peter Williams
2007-05-30  4:42                                 ` Siddha, Suresh B
2007-05-30  6:28                                   ` Peter Williams
2007-05-31  1:49                                   ` Peter Williams
2007-05-22 11:52               ` Dmitry Adamushko
2007-05-23  0:10                 ` Peter Williams
2007-05-18  0:18 ` Bill Huey
2007-05-18  1:01   ` Bill Huey
2007-05-18  4:13   ` William Lee Irwin III
2007-05-18  7:31   ` Ingo Molnar

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=464DA61A.4040406@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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