public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: Matt Mackall <mpm@selenic.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Interesting interaction between lguest and CFS
Date: Tue, 5 Jun 2007 21:50:15 +0200	[thread overview]
Message-ID: <20070605195015.GA24348@elte.hu> (raw)
In-Reply-To: <b647ffbd0706050841v2a326fb4n128249131ccbc11a@mail.gmail.com>


* Dmitry Adamushko <dmitry.adamushko@gmail.com> wrote:

> On 05/06/07, Dmitry Adamushko <dmitry.adamushko@gmail.com> wrote:
> >> now at 257428593818894 nsecs
> >>
> >> cpu: 0
> >>   .nr_running            : 3
> >>   .raw_weighted_load     : 2063
> >>   .nr_switches           : 242830075
> >>   .nr_load_updates       : 30172063
> >>   .nr_uninterruptible    : 0
> >>   .jiffies               : 64282148
> >>   .next_balance          : 0
> >>   .curr->pid             : 27182
> >>   .clock                 : 125650217819008823
> >>   .prev_clock_raw        : 257428516403535
> >
> >The delta (clock - prev_clock_raw) looks insane.
> >
> 
> err.. please ignore it. 'clock' and 'prev_clock_raw' follow each other 
> only as long as the 'clock_warps' == 0.. otherwise 'delta' just 
> doesn't make any sense. And in your case:
> 
>  .clock_warps           : 9

yeah. Look at the sched_clock() reliability counts:

  .clock_warps           : 9
  .clock_unstable_events : 41133344
  .clock_max_delta       : 3954619

i.e. a quite large 'tsc unstable events' counter and with a handful 
negative warps detected, the actual maximum TSC delta was 3954 usecs 
(clock_max_delta), so i think rq_clock() behaved sane and sched_clock() 
has good quality on Matt's box. So the large block_max is still 
mysterious to me:

  > > sleep_max                :         57476665627
  > > block_max                :   18014060106626075

because the whole rq_clock() logic is about avoiding large jumps. So i 
dont see how 'now' could _ever_ have ended up being so very large. Even 
if the new sched-clock code in arch/i386/kernel/sched-clock.c frequently 
switches between sc->unstable == 0 or 1, (i.e. frequently switches 
between jiffies based and TSC based clock), the rq_clock() logic should 
cushion off any jumpiness or small warps from that. I'm wondering 
whether this line:

                r = (jiffies_64 - sc->sync_base) * (1000000000 / HZ);

could produce funnies. But even if it does, it could at most produce a 
very large _positive_ jump - which they would have to show up in 
clock_max_delta. Negative jumps are completely ignored by rq_clock(). 

although ... the 'raw' rq_clock() values are very large:

  .clock                 : 125650217819008823

  $ printf "%016Lx\n" 125650217819008823
  01be6635170d6f37

which could be due to some TSC corruption? So perhaps somewhere we 
calculated block_max with 'now' zero, hence resulting in that very large 
value? Still, i dont see how that could happen. Weird.

it would be nice to monitor how 'clock' changes in time on that box. It 
should be advancing monotonically and at most with the speed of the CPU 
clock. (but it can move slower, over C3/unstable/cpufreq periods.) This 
could be done the following way:

   while sleep 1; do cat /proc/sched_debug >> sched_debug.txt; done

Matt, could you run this for 1-2 minutes and send us the sched_debug.txt 
output?

	Ingo

  reply	other threads:[~2007-06-05 19:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-04 17:37 Interesting interaction between lguest and CFS Matt Mackall
2007-06-04 17:54 ` Ingo Molnar
2007-06-04 18:41   ` Matt Mackall
2007-06-05  7:19     ` Ingo Molnar
2007-06-05 14:03       ` Matt Mackall
2007-06-05 15:14         ` Dmitry Adamushko
2007-06-05 15:41           ` Dmitry Adamushko
2007-06-05 19:50             ` Ingo Molnar [this message]
2007-06-06 20:23               ` Matt Mackall
2007-06-08  9:34                 ` Ingo Molnar
2007-06-08 10:18                   ` Ingo Molnar
2007-06-04 18:11 ` Ingo Molnar
2007-06-04 18:42   ` Matt Mackall
2007-06-04 19:12     ` Ingo Molnar
2007-06-04 19:27       ` Matt Mackall
2007-06-04 19:40         ` Ingo Molnar
2007-06-04 19:59           ` Matt Mackall
2007-06-04 20:13             ` Ingo Molnar
2007-06-04 20:20               ` Ingo Molnar
2007-06-04 20:15   ` James Morris
2007-06-04 20:24     ` Ingo Molnar
2007-06-04 22:58 ` Olof Johansson
2007-06-05  1:02   ` Rusty Russell
2007-06-05  1:24     ` Stephen Rothwell
2007-06-05  2:23     ` Olof Johansson
2007-06-05  0:18 ` Rusty Russell
2007-06-05  2:31   ` Rusty Russell
2007-06-05  4:18     ` Matt Mackall
2007-06-05  4:37       ` Rusty Russell
2007-06-05 13:49         ` Matt Mackall
2007-06-05 19:38           ` Ingo Molnar
2007-06-05 10:43       ` Ingo Molnar
2007-06-05 19:08         ` Ingo Molnar
2007-06-06 20:19           ` Matt Mackall
2007-06-05  2:34   ` Matt Mackall
2007-06-05  7:10   ` Ingo Molnar
2007-06-05  9:23 ` Ingo Molnar
2007-06-05 14:06   ` Matt Mackall

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=20070605195015.GA24348@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=rusty@rustcorp.com.au \
    /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