All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Newall <david@davidnewall.com>
To: Micah Dowty <micah@vmware.com>
Cc: Kyle Moffett <mrmacman_g4@mac.com>,
	Cyrus Massoumi <cyrusm@gmx.net>,
	LKML Kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
	Mike Galbraith <efault@gmx.de>, Paul Menage <menage@google.com>,
	Christoph Lameter <clameter@sgi.com>
Subject: Re: High priority tasks break SMP balancer?
Date: Sat, 17 Nov 2007 05:43:33 +1030	[thread overview]
Message-ID: <473DEBDD.2010706@davidnewall.com> (raw)
In-Reply-To: <20071115191408.GA4914@vmware.com>

There are a couple of points I would make about your python test 
harness.  Your program compares real+system jiffies for both cpus; an 
ideal result would be 1.00.  The measurement is taken over a relatively 
short period of approximately a half-second, and you kill the CPU hogs 
before taking final measurements, even wait for them to die first.  You 
repeat this measurement, starting and killing CPU hogs each time.  Why 
do you do that?

What happens if you start the hogs and take the baseline outside of the 
loop?

    from __future__ import division
    import sys, os, time

    def getCpuTimes():
        cpu0 = 0
        cpu1 = 1
        for line in open("/proc/stat"):
            tokens = line.split()
            if tokens[0] == "cpu0":
                cpu0 = int(tokens[1]) + int(tokens[3])
            elif tokens[0] == "cpu1":
                cpu1 = int(tokens[1]) + int(tokens[3])
        return cpu0, cpu1

    pid = os.spawnl(os.P_NOWAIT, "./priosched")
    baseline = getCpuTimes()
    while True:
        time.sleep(0.5)
        current = getCpuTimes()
        print "%.04f" % (current[0] - baseline[0]) / (current[1] -
    baseline[1])


  parent reply	other threads:[~2007-11-16 19:13 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 22:34 High priority tasks break SMP balancer? Micah Dowty
2007-11-09 23:56 ` Cyrus Massoumi
2007-11-10  0:11   ` Micah Dowty
2007-11-14 18:39     ` Micah Dowty
2007-11-15 18:48     ` Kyle Moffett
2007-11-15 19:14       ` Micah Dowty
2007-11-15 20:07         ` Christoph Lameter
2007-11-15 20:24           ` Micah Dowty
2007-11-15 21:28             ` Christoph Lameter
2007-11-15 21:35               ` Micah Dowty
2007-11-16  2:31                 ` Christoph Lameter
2007-11-16  2:44                   ` Micah Dowty
2007-11-16  6:07                     ` Ingo Molnar
2007-11-16  9:19                       ` Micah Dowty
2007-11-16 10:45                         ` Ingo Molnar
2007-11-16 10:48                       ` Micah Dowty
2007-11-16 22:12                         ` Christoph Lameter
2007-11-16 10:48                       ` Dmitry Adamushko
2007-11-16 22:14                         ` Micah Dowty
2007-11-16 23:26                           ` Dmitry Adamushko
2007-11-17  1:03                             ` Micah Dowty
2007-11-17 19:10                               ` Dmitry Adamushko
2007-11-19 18:51                                 ` Micah Dowty
2007-11-19 22:22                                   ` Dmitry Adamushko
2007-11-19 23:05                                     ` Micah Dowty
2007-11-20  5:57                                       ` Ingo Molnar
2007-11-20 18:06                                         ` Micah Dowty
2007-11-20 21:47                                           ` Dmitry Adamushko
2007-11-22  7:46                                             ` Micah Dowty
2007-11-22 12:53                                               ` Dmitry Adamushko
2007-11-26 19:44                                                 ` Micah Dowty
2007-11-27  9:21                                                   ` Dmitry Adamushko
2007-11-27 17:13                                                     ` Micah Dowty
2007-11-16 19:13         ` David Newall [this message]
2007-11-16 21:38           ` Micah Dowty

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=473DEBDD.2010706@davidnewall.com \
    --to=david@davidnewall.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=cyrusm@gmx.net \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=micah@vmware.com \
    --cc=mingo@elte.hu \
    --cc=mrmacman_g4@mac.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.