9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Performance
@ 2001-05-08 17:54 nemo
  2001-05-08 18:46 ` Scott Schwartz
  0 siblings, 1 reply; 24+ messages in thread
From: nemo @ 2001-05-08 17:54 UTC (permalink / raw)
  To: 9fans

I've been a daily linux user until  3rd edition came out
(when I became a daily plan9 user). I have noticed
that the memory usage for me is 1/10th or so w/ Plan9 wrt Linux
(I include X and gnome here).

Regarding speed, the system `looks' (again for me as a user,
no measures taken) more or less like linux but for a couple
of things I noticed:

 - network transfers are slower in my case using Plan 9.
   (but fast enough).
 - mail processing is a lot slower in my case using Plan 9,
   perhaps due to the combination of acme Mail, upas/fs and the
   network; But again, for me it's fast enough. 



^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-11 13:52 jmk
  0 siblings, 0 replies; 24+ messages in thread
From: jmk @ 2001-05-11 13:52 UTC (permalink / raw)
  To: 9fans

On Fri May 11 04:42:36 EDT 2001, DAGwyn@null.net wrote:
> jmk@plan9.bell-labs.com wrote:
> > I think the correct kludge is to wait for the clock interrupt.
> 
> Also the most portable.

You learn something new every day. Charles Forsyth pointed out to me
that had I read the x86 description of the STI command as well as HLT
I would see there is no possibility of an interrupt occurring between
the sequence
	STI
	HLT
as the STI allows interrupts to be responded to after the completion
of the following instruction, and HLT is deemed to have completed when
it enters its halt state. Therefore, I think a possible way to close
the window on the x86 is

TEXT halt(SB), $0
	CLI
	CMPL	nrdy(SB), $0
	JEQ	_nothingready
	STI
	RET

_nothingready:
	STI
	HLT
	RET

Whether this is coded correctly or makes a difference is left as an
exercise for the student.

--jim


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-10 17:21 jmk
  2001-05-11  8:33 ` Douglas A. Gwyn
  0 siblings, 1 reply; 24+ messages in thread
From: jmk @ 2001-05-10 17:21 UTC (permalink / raw)
  To: 9fans


On Thu May 10 11:31:55 EDT 2001, DAGwyn@null.net wrote:
> Richard Miller wrote:
> > Isn't there a race condition here even on a uniprocessor?  The scan
> > of the run queue and call to HLT are done with interrupts enabled:
> 
> Yes, the canonical solution, which addresses HLT on MP systems
> as well, is that whatever modifies the run queue always as a side
> effect wakes up all the dispatchers.  Some platforms support use
> of a software interrupt just as though it were a hardware
> interrupt; on others a kludge would be required, or else just
> leave it up to the clock interrupt.

Waking up other processors would require interprocessor interrupts
and that way lies madness.

A software interrupt on a uniprocessor wouldn't fix the race.

I think the correct kludge is to wait for the clock interrupt.


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-09 14:47 Richard Miller
  2001-05-10 15:14 ` Douglas A. Gwyn
  0 siblings, 1 reply; 24+ messages in thread
From: Richard Miller @ 2001-05-09 14:47 UTC (permalink / raw)
  To: 9fans

> Of course, on a multiprocessor, something can be put on the run
> queue by another processor without an external event occurring on
> this processor, so the HLT instruction isn't used in that case.

Isn't there a race condition here even on a uniprocessor?  The scan
of the run queue and call to HLT are done with interrupts enabled:

 - scheduler scans run queue, finds no ready process
 - scheduler calls halt()
 - interrupt occurs, placing process P on the run queue
 - halt() executes HLT instruction
 - dispatch of process P is delayed until (worst case) the next
   clock interrupt

-- Richard



^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-09 13:03 presotto
  0 siblings, 0 replies; 24+ messages in thread
From: presotto @ 2001-05-09 13:03 UTC (permalink / raw)
  To: 9fans

Or to put it more simply, if there was nothing to run, the problem
is waiting for something to happen outside of the cpu, usually a
remote file system.  Were you running with a local file system or
a file server.  If the former, you were probably waiting for disk,
if the latter, for the file server.


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-09 12:57 jmk
  0 siblings, 0 replies; 24+ messages in thread
From: jmk @ 2001-05-09 12:57 UTC (permalink / raw)
  To: 9fans

On Wed May  9 04:44:05 EDT 2001, pschay@pobox.com wrote:
> Hi,
> 
> There are many things besides kernel compilation that
> are also really fast compared to other systems: booting,
> compiling the window system, running the window system,
> ....
> 
> Anyway, as fast as kernel compilation is, I do have some
> questions about the performance.  I tried a few ways of
> profiling the kernel during kernel compilation.  At first
> I found that a lot of the kernel time was spent in halt()
> so I changed HLT to NOP in l.s.  Now almost a third of the
> time is apparently spent in runproc().
> 
> Is this a fixable problem?  Or is it actually the desired
> behavior?  (All I can imagine is that maybe the scheduler
> sacrifices the good of the few for the good of the many and
> me + my measly kernel compilation processes are not the
> common case?  Or perhaps scheduling typically consumes this
> kind of overhead?)  I know zilch about schedulers so
> I'd greatly appreciate any insight, or pointers to
> literature.  I think I recall reading a brief posting a year
> or two ago by one of the experts who said something to the
> effect that the scheduler has lots of room for improvement.
> Why? How? Could anybody elaborate?
> 
> Thanks.
> -Pete

The system looks for processes to run by scanning the run queues
in runproc(). If it doesn't find anything it just keeps looking until
something is put in the queue. Nothing can be put in the queue
except by an external event happening, i.e. some interrupt causes
a process to change state. The HLT instruction waits until an
interrupt occurs then continues. As you observed, you can replace
HLT with a NOP (or take the call to the routine out entirely) to
no ill effect, and this is what the system used to do. However,
HLT gives the processor opportunities to conserve power and thereby
run cooler and lengthen battery life, etc.

Of course, on a multiprocessor, something can be put on the run
queue by another processor without an external event occurring on
this processor, so the HLT instruction isn't used in that case.

--jim


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-09  8:58 forsyth
  0 siblings, 0 replies; 24+ messages in thread
From: forsyth @ 2001-05-09  8:58 UTC (permalink / raw)
  To: 9fans

>>Anyway, as fast as kernel compilation is, I do have some
>>questions about the performance.  I tried a few ways of
>>profiling the kernel during kernel compilation.  At first
>>I found that a lot of the kernel time was spent in halt()
>>so I changed HLT to NOP in l.s.  Now almost a third of the
>>time is apparently spent in runproc().

it's in runproc waiting for something to do (hence the HLT in later versions).
perhaps your action is i/o bound.



^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-09  6:03 nemo
  0 siblings, 0 replies; 24+ messages in thread
From: nemo @ 2001-05-09  6:03 UTC (permalink / raw)
  To: 9fans

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

Even so. Take into account that I was talking about the
total memory usage (system+apps). Linux apps tend to be 
of the memory consuming kind.


[-- Attachment #2: Type: message/rfc822, Size: 1821 bytes --]

From: Scott Schwartz <schwartz@bio.cse.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Performance
Date: Tue, 08 May 2001 14:46:39 -0400
Message-ID: <20010508184639.17683.qmail@f.bio.cse.psu.edu>

| that the memory usage for me is 1/10th or so w/ Plan9 wrt Linux
| (I include X and gnome here).

Even counting wired down memory for /dev/draw in the kernel?

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-08 21:33 Russ Cox
  2001-05-09  2:09 ` Ronald G Minnich
  2001-05-10 15:15 ` Douglas A. Gwyn
  0 siblings, 2 replies; 24+ messages in thread
From: Russ Cox @ 2001-05-08 21:33 UTC (permalink / raw)
  To: 9fans

> it's just not worth the trouble. last time i looked it was so unix-centric
> the results would be meaningless. how many line of code does it take to
> determine the clock-rate of the cpu, doesn't the firmware print it out when
> the machine boots?

On the other hand, lmbench might be more suited to 
Plan 9 than to Unix.  At least on Plan 9 you can
be more certain that you're measuring something real,
as opposed to code that gcc has optimized into the
empty instruction sequence.

</lmbench flame>

Russ


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-08 21:25 jmk
  0 siblings, 0 replies; 24+ messages in thread
From: jmk @ 2001-05-08 21:25 UTC (permalink / raw)
  To: 9fans

On Tue May  8 14:46:27 EDT 2001, schwartz@bio.cse.psu.edu wrote:
> lmbench would be interesting to run once in a while.  The overheads
> introduced by APE might be problematic, though.

it's just not worth the trouble. last time i looked it was so unix-centric
the results would be meaningless. how many line of code does it take to
determine the clock-rate of the cpu, doesn't the firmware print it out when
the machine boots?


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-08 18:20 jmk
  2001-05-09  8:29 ` Peter Schay
  0 siblings, 1 reply; 24+ messages in thread
From: jmk @ 2001-05-08 18:20 UTC (permalink / raw)
  To: 9fans

Almost any speed comparisons will show Plan 9 as coming in 2nd,
except for the time it takes to compile the kernel.


^ permalink raw reply	[flat|nested] 24+ messages in thread
* [9fans] Performance
@ 2001-05-08 17:42 Fariborz 'Skip' Tavakkolian
  2001-05-08 18:07 ` aam396
  2001-05-08 22:38 ` Boyd Roberts
  0 siblings, 2 replies; 24+ messages in thread
From: Fariborz 'Skip' Tavakkolian @ 2001-05-08 17:42 UTC (permalink / raw)
  To: 9fans

Are there any published performance numbers more recent than those
mentioned in 9 and net papers? Any for typical PC platforms compared
to Linux or FreeBSD?



^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [9fans] Performance
@ 2001-05-08 17:40 presotto
  2001-05-08 18:45 ` Scott Schwartz
  2001-05-09  5:35 ` Franklin Robert Araujo Fran€a
  0 siblings, 2 replies; 24+ messages in thread
From: presotto @ 2001-05-08 17:40 UTC (permalink / raw)
  To: 9fans

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

Not that i know of

[-- Attachment #2: Type: message/rfc822, Size: 1522 bytes --]

From: "Fariborz 'Skip' Tavakkolian" <fst@real.com>
To: 9fans@cse.psu.edu
Subject: [9fans] Performance
Date: Tue, 08 May 2001 10:42:15 -0700
Message-ID: <3.0.5.32.20010508104215.01407b50@mail.real.com>

Are there any published performance numbers more recent than those
mentioned in 9 and net papers? Any for typical PC platforms compared
to Linux or FreeBSD?

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2001-05-11 13:52 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-08 17:54 [9fans] Performance nemo
2001-05-08 18:46 ` Scott Schwartz
  -- strict thread matches above, loose matches on Subject: below --
2001-05-11 13:52 jmk
2001-05-10 17:21 jmk
2001-05-11  8:33 ` Douglas A. Gwyn
2001-05-09 14:47 Richard Miller
2001-05-10 15:14 ` Douglas A. Gwyn
2001-05-09 13:03 presotto
2001-05-09 12:57 jmk
2001-05-09  8:58 forsyth
2001-05-09  6:03 nemo
2001-05-08 21:33 Russ Cox
2001-05-09  2:09 ` Ronald G Minnich
2001-05-10 15:15 ` Douglas A. Gwyn
2001-05-08 21:25 jmk
2001-05-08 18:20 jmk
2001-05-09  8:29 ` Peter Schay
2001-05-08 17:42 Fariborz 'Skip' Tavakkolian
2001-05-08 18:07 ` aam396
2001-05-08 22:38 ` Boyd Roberts
2001-05-08 17:40 presotto
2001-05-08 18:45 ` Scott Schwartz
2001-05-09  5:35 ` Franklin Robert Araujo Fran€a
2001-05-10  8:43   ` Juhani Forsman

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).