9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] interesting timing tests
Date: Sun, 20 Jun 2010 17:55:32 -0400	[thread overview]
Message-ID: <da2c7d30ad147fca47014c09d339aa1b@kw.quanstro.net> (raw)
In-Reply-To: <97d3416a6d7cadb18e8723fff3d2e2a8@hamnavoe.com>

[-- Attachment #1: Type: text/plain, Size: 3855 bytes --]

> > yet for one machine conf.nmach == 4 and for the
> > other conf.nmach == 16; neither is calling halt.
>
> Hypothesis: with four processors there's enough work to keep all
> the cpus busy.  With sixteen processors you're getting i/o bound
> (where's the filesystem coming from?) so some of the cpus are
> idling, and would call halt if they were allowed to.

it seems to be a tad more complicated than that.
these machines "aren't doing anything"; i'm the only
one logged in, and they run no services.

16cpus; >/dev/kpctl echo startclr; sleep 5;>/dev/kpctl echo stop; \
	kprof /386/9pccpu /dev/kpdata | sed 10q
total: 79782	in kernel text: 79782	outside kernel text: 0
KTZERO f0100000
ms	  %	sym
60348	 75.2	runproc
9125	 11.3	_cycles
6230	  7.7	perfticks
2696	  3.3	isaconfig
1271	  1.5	idlehands
1127	  1.4	microdelay
1	  0.0	freepte

4cpus; >/dev/kpctl echo startclr; sleep 5;>/dev/kpctl echo stop; \
	kprof /386/9pccpu /dev/kpdata | sed 10q
total: 20327	in kernel text: 20327	outside kernel text: 0
KTZERO f0100000
ms	  %	sym
8124	 40.2	rebalance
5261	 26.0	runproc
3252	 16.1	_cycles
1997	  9.9	perfticks
702	  3.4	microdelay
548	  2.7	idlehands
349	  1.7	isaconfig

this trend continues with burncycles, a program
(attached) that actually does stuff on n cpus:

4cpus; for(i in 1 2 4){
	>/dev/kpctl echo startclr;
	>/dev/null time 8.burncycles $i;
	>/dev/kpctl echo stop;
	kprof /386/9pccpu /dev/kpdata|sed 10q
}
10.56u 0.00s 10.56r 	 8.burncycles 1
total: 42246	in kernel text: 31684	outside kernel text: 10562
KTZERO f0100000
ms	  %	sym
12693	 40.0	rebalance
8324	 26.2	runproc
5215	 16.4	_cycles
3182	 10.0	perfticks
1088	  3.4	microdelay
902	  2.8	idlehands
611	  1.9	isaconfig
10.56u 0.00s 10.56r 	 8.burncycles 2
total: 42561	in kernel text: 21441	outside kernel text: 21120
KTZERO f0100000
ms	  %	sym
8567	 39.9	rebalance
5558	 25.9	runproc
3483	 16.2	_cycles
2190	 10.2	perfticks
742	  3.4	microdelay
590	  2.7	idlehands
408	  1.9	isaconfig
10.56u 0.00s 10.56r 	 8.burncycles 4
total: 42524	in kernel text: 428	outside kernel text: 42096
KTZERO f0100000
ms	  %	sym
159	 37.1	rebalance
120	 28.0	runproc
63	 14.7	_cycles
49	 11.4	perfticks
17	  3.9	idlehands
9	  2.1	isaconfig
9	  2.1	microdelay

8cpus; for(i in 1 2 4 8 16){
	>/dev/kpctl echo startclr;
	>/dev/null time 8.burncycles $i;
	>/dev/kpctl echo stop;
	kprof /386/9pccpu /dev/kpdata|sed 10q
}
17.26u 0.00s 17.26r 	 8.burncycles 1
total: 265856	in kernel text: 248594	outside kernel text: 17262
KTZERO f0100000
ms	  %	sym
191427	 77.0	runproc
28607	 11.5	_cycles
21218	  8.5	perfticks
8618	  3.4	isaconfig
4408	  1.7	idlehands
3584	  1.4	microdelay
1	  0.0	nhgets
17.64u 0.00s 17.64r 	 8.burncycles 2
total: 276561	in kernel text: 241360	outside kernel text: 35201
KTZERO f0100000
ms	  %	sym
181186	 75.0	runproc
26816	 11.1	_cycles
23267	  9.6	perfticks
8049	  3.3	isaconfig
4261	  1.7	idlehands
3483	  1.4	microdelay
2	  0.0	sleep
18.87u 0.00s 18.87r 	 8.burncycles 4
total: 297021	in kernel text: 225113	outside kernel text: 71908
KTZERO f0100000
ms	  %	sym
168136	 74.6	runproc
24904	 11.0	_cycles
22849	 10.1	perfticks
7462	  3.3	isaconfig
3879	  1.7	idlehands
3058	  1.3	microdelay
1	  0.0	ilock
18.65u 0.00s 18.65r 	 8.burncycles 8
total: 289838	in kernel text: 148804	outside kernel text: 141034
KTZERO f0100000
ms	  %	sym
117215	 78.7	runproc
16729	 11.2	_cycles
12872	  8.6	perfticks
5119	  3.4	isaconfig
2765	  1.8	idlehands
2064	  1.3	microdelay
2	  0.0	sleep
19.34u 0.00s 19.35r 	 8.burncycles 16
total: 281308	in kernel text: -9895	outside kernel text: 291203
KTZERO f0100000
ms	  %	sym
497	 -5.0	runproc
78	  0.-7	_cycles
50	  0.-5	perfticks
14	  0.-1	isaconfig
10	  0.-1	microdelay
8	  0.0	idlehands
1	  0.0	ilock

- erik

[-- Attachment #2: burncycles.c --]
[-- Type: text/plain, Size: 787 bytes --]

#include <u.h>
#include <libc.h>
#include <thread.h>

#define Scale	(100000000000ull)

/*
 * waste time
 */
vlong
πjj(uint j)
{
	vlong v;

	v = 4*Scale / (2*j + 1);
	if(j&1)
		return -v;
	return v;
}

vlong
π(void)
{
	uint i;
	vlong v;

	v = 0;
	for(i = 0; i < 500000000; i++)
		v += πjj(i);
	return v;
}

void
p(void *v)
{
	int i;

	i = (int)v;
	print("%d: %lld\n", i, π());
	threadexits("");
}

void
usage(void)
{
	fprint(2, "usage: burncycles nthread\n");
	threadexits("usage");
}

void
threadmain(int argc, char **argv)
{
	int n, i;

	ARGBEGIN{
	default:
		usage();
	}ARGEND
	n = 1;
	else if(argc > 1 || (n = atoi(argv[0])) <= 0)
		usage();
	for(i = 0; i < n-1; i++)
		proccreate(p, (void*)i, 4096);
	p((void*)i);
}

  reply	other threads:[~2010-06-20 21:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-18 23:26 erik quanstrom
2010-06-19 13:42 ` Richard Miller
2010-06-20  1:36   ` erik quanstrom
2010-06-20  7:44     ` Richard Miller
2010-06-20 12:45       ` erik quanstrom
2010-06-20 16:51         ` Richard Miller
2010-06-20 21:55           ` erik quanstrom [this message]
2010-06-21  1:41             ` erik quanstrom
2010-06-21  3:46               ` Venkatesh Srinivas
2010-06-21 14:40                 ` erik quanstrom
2010-06-21 16:42                   ` Venkatesh Srinivas
2010-06-21 16:43                   ` erik quanstrom
2010-06-21 21:11 ` Bakul Shah
2010-06-21 21:21   ` erik quanstrom
2010-06-21 21:47     ` Bakul Shah
2010-06-21 22:16       ` erik quanstrom
2010-06-22  3:24 ` Lawrence E. Bakst
2010-06-23  1:09   ` erik quanstrom

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=da2c7d30ad147fca47014c09d339aa1b@kw.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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).