linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Turner <pjt@google.com>
To: James Courtier-Dutton <james.dutton@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>, Ingo Molnar <mingo@elte.hu>,
	Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] sched: automated per session task groups
Date: Wed, 15 Dec 2010 04:10:08 -0800	[thread overview]
Message-ID: <AANLkTikdNe4mhx8E0J1C9vcOu4cdmr8KAMnAvrJeWzGq@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimUiPVrJ8KY1Tj_qGJmDbSmy3BUuudeAWeQ88Fc@mail.gmail.com>

This goose is now cooked.

It turns out the new shares code is doing the "right" thing, but in
the wrong order for tasks with very small time slices.  This made it
rather gnarly to track down since at all times the new evaluation /
the old evaluation / and an "OPT" evaluation were all in agreement!

As we hierarchically dequeue we now instantaneously adjust entity
weights to account for the new global state (good).  However, when we
then update on the parent (e.g. the group entity owning the
just-adjusted cfs_rq), the accrued unaccounted time is charged at the
new weight for that entity instead of the old.

For longer running processes, the periodic updates hide this.
However, for an interactive process, such as Xorg (which uses many
_small_ timeslices -- e.g. almost all accounting ends up being at
dequeue as opposed to periodic) this results in significant vruntime
over-charging and a loss of fairness.  In Xorg's case the loss of
fairness is compounded by the fact that there is only one runnable
thread means we transition between NICE_0_LOAD and MIN_SHARES for the
over-charging above.

This is fixed by charging the unaccounted time versus a group entity
before we manipulate its weight (as a result of child movement).

Thanks for your patience while I tracked this down.. it's been a few
sleepless nights while I cranked through a number of dead-end theories
(rather frustrating when the numbers are all right but the results are
all wrong! ;).  Cleaned up patch inbound in the morning.

- Paul

On Tue, Dec 7, 2010 at 3:32 AM, Paul Turner <pjt@google.com> wrote:
> Desktop hardware came in today and I can now reproduce the issues
> Mike's been seeing; tuning in progress.
>
> On Sat, Dec 4, 2010 at 9:11 PM, Paul Turner <pjt@google.com> wrote:
>> On Sat, Dec 4, 2010 at 3:55 PM, James Courtier-Dutton
>> <james.dutton@gmail.com> wrote:
>>> On 3 December 2010 05:11, Paul Turner <pjt@google.com> wrote:
>>>>
>>>> I actually don't have a desktop setup handy to test "interactivity" (sad but
>>>> true -- working on grabbing one).  But it looks better on under synthetic
>>>> load.
>>>>
>>>
>>> What tools are actually used to test "interactivity" ?
>>> I posted a tool to the list some time ago, but I don't think anyone noticed.
>>> My tool is very simple.
>>> When you hold a key down, it should repeat. It should repeat at a
>>> constant predictable interval.
>>> So, my tool just waits for key presses and times when each one occurred.
>>> The tester simply presses a key and holds it down.
>>> If the time between each key press is constant, it indicates good
>>> "interactivity". If the time between each key press varies a lot, it
>>> indicates bad "interactivity".
>>> You can reliably test if one kernel is better than the next using
>>> actual measurable figures.
>>>
>>> Kind Regards
>>>
>>> James
>>>
>>
>> Could you drop me a pointer?  I can certainly give it a try.  It would
>> be extra useful if it included any histogram functionality.
>>
>> I've been using a combination of various synthetic wakeup and load
>> scripts and measuring the received bandwidth / wakeup latency.
>>
>> They have not succeeded in reproducing the starvation or poor latency
>> observed by Mike above however.  (Although I've pulled a box to try
>> reproducing his exact conditions [ e.g. user environment ] on Monday).
>>
>

  reply	other threads:[~2010-12-15 12:10 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-21 13:37 [PATCH v4] sched: automated per session task groups Ingo Molnar
2010-11-21 13:39 ` Ingo Molnar
2010-11-21 15:44   ` Oleg Nesterov
2010-11-21 16:35     ` Mike Galbraith
2010-11-21 16:15 ` Mike Galbraith
2010-11-21 18:43 ` Gene Heskett
2010-11-25 16:00 ` Mike Galbraith
2010-11-28 14:24   ` Mike Galbraith
2010-11-28 19:31     ` Linus Torvalds
2010-11-28 20:18       ` Ingo Molnar
2010-11-29 11:53         ` Peter Zijlstra
2010-11-29 12:30           ` Ingo Molnar
2010-11-29 13:45             ` Mike Galbraith
2010-11-29 13:47               ` Ingo Molnar
2010-11-29 14:04                 ` Mike Galbraith
2010-11-29 16:27           ` Linus Torvalds
2010-11-29 16:44             ` Ingo Molnar
2010-11-29 17:37             ` Peter Zijlstra
2010-11-29 18:03               ` Ingo Molnar
2010-11-29 19:06               ` Mike Galbraith
2010-11-29 19:20                 ` Ingo Molnar
2010-11-30  3:39                   ` Paul Turner
2010-11-30  4:14                     ` Mike Galbraith
2010-11-30  4:23                       ` Paul Turner
2010-11-30 13:18                         ` Mike Galbraith
2010-11-30 13:48                           ` Peter Zijlstra
2010-11-30 13:59                             ` Ingo Molnar
2010-11-30 14:13                           ` Ingo Molnar
2010-11-30 16:41                             ` Mike Galbraith
2010-11-30 15:17                           ` Vivek Goyal
2010-11-30 17:13                             ` Mike Galbraith
2010-11-30 19:36                               ` Vivek Goyal
2010-12-01  5:01                                 ` Américo Wang
2010-12-01  6:09                                   ` Mike Galbraith
2010-12-01 11:36                                   ` Peter Zijlstra
2010-12-01 22:12                                   ` Valdis.Kletnieks
2010-12-01  5:57                                 ` Mike Galbraith
2010-12-01 11:33                                   ` Peter Zijlstra
2010-12-01 11:55                                     ` Mike Galbraith
2010-12-01 14:55                                   ` Vivek Goyal
2010-12-01 15:04                                     ` Mike Galbraith
2010-11-30  7:54                   ` Mike Galbraith
2010-11-30 14:18                     ` Ingo Molnar
2010-11-30 14:53                       ` Ingo Molnar
2010-11-30 15:01                         ` Peter Zijlstra
2010-11-30 15:11                           ` Ingo Molnar
2010-11-30 16:28                       ` Mike Galbraith
2010-11-29  5:45       ` Mike Galbraith
2010-12-01  3:39     ` Paul Turner
2010-12-01  3:39     ` Paul Turner
2010-12-01  6:16       ` Mike Galbraith
2010-12-03  5:11         ` Paul Turner
2010-12-03  6:48           ` Mike Galbraith
2010-12-03  8:37             ` Paul Turner
2010-12-04 23:55           ` James Courtier-Dutton
2010-12-05  5:11             ` Paul Turner
2010-12-07 11:32               ` Paul Turner
2010-12-15 12:10                 ` Paul Turner [this message]
2010-12-01 11:34       ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2010-11-15  1:13 [RFC/RFT PATCH v3] sched: automated per tty " Mike Galbraith
2010-11-15  8:57 ` Peter Zijlstra
2010-11-15 11:32   ` Mike Galbraith
2010-11-15 11:46     ` Mike Galbraith
2010-11-15 12:57       ` Oleg Nesterov
2010-11-15 21:25         ` Mike Galbraith
2010-11-16 13:04           ` Oleg Nesterov
2010-11-16 14:18             ` Mike Galbraith
2010-11-16 15:03               ` Oleg Nesterov
2010-11-16 15:41                 ` Mike Galbraith
2010-11-16 17:28                   ` Ingo Molnar
2010-11-20 19:35                     ` [PATCH v4] sched: automated per session " Mike Galbraith
2010-12-04 17:39                       ` Colin Walters
2010-12-04 18:33                         ` Linus Torvalds
2010-12-04 20:01                           ` Colin Walters
2010-12-04 22:39                             ` Linus Torvalds
2010-12-04 23:43                               ` Colin Walters
2010-12-05  0:31                                 ` Linus Torvalds
2010-12-05  7:47                                 ` Ray Lee
2010-12-05 19:22                                   ` Colin Walters
2010-12-05 20:47                                     ` Linus Torvalds
2010-12-05 22:47                                       ` Colin Walters
2010-12-05 22:58                                         ` Jesper Juhl
2010-12-05 23:05                                           ` Jesper Juhl
2010-12-07 18:51                                       ` Peter Zijlstra
2010-12-05 10:18                                 ` Con Kolivas
2010-12-05 11:36                                   ` Mike Galbraith
2010-12-05 20:58                                   ` Ingo Molnar
2010-12-04 23:31                             ` david
2010-12-05 11:11                             ` Nikos Chantziaras
2010-12-06  0:28                             ` Valdis.Kletnieks

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=AANLkTikdNe4mhx8E0J1C9vcOu4cdmr8KAMnAvrJeWzGq@mail.gmail.com \
    --to=pjt@google.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=james.dutton@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.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).