9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] memory
@ 2005-02-07  7:16 tapique
  2005-02-08  4:52 ` Russ Cox
  0 siblings, 1 reply; 14+ messages in thread
From: tapique @ 2005-02-07  7:16 UTC (permalink / raw)
  To: 9fans

hi,
can someone show me the pros and cons of having kernel and user memory spaces
separated? just would like to learn...
thanks,
++pac.


--------------------------
Posílejte SMS přes internet zdarma a bez reklamy. Pouze s TISCALI.
Více na http://www.tiscali.cz





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

* Re: [9fans] memory
  2005-02-07  7:16 [9fans] memory tapique
@ 2005-02-08  4:52 ` Russ Cox
  2005-02-08  5:12   ` Lucio De Re
  0 siblings, 1 reply; 14+ messages in thread
From: Russ Cox @ 2005-02-08  4:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

pro: errant user programs can't scribble all over the
kernel's memory and cause it to crash.  
con: that makes it harder to simulate dos and windows.

russ

On Mon, 7 Feb 2005 08:16:22 +0100, tapique@tiscali.cz
<tapique@tiscali.cz> wrote:
> hi,
> can someone show me the pros and cons of having kernel and user memory spaces
> separated? just would like to learn...
> thanks,
> ++pac.
> 
> --------------------------
> Posílejte SMS přes internet zdarma a bez reklamy. Pouze s TISCALI.
> Více na http://www.tiscali.cz
> 
>


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

* Re: [9fans] memory
  2005-02-08  4:52 ` Russ Cox
@ 2005-02-08  5:12   ` Lucio De Re
  0 siblings, 0 replies; 14+ messages in thread
From: Lucio De Re @ 2005-02-08  5:12 UTC (permalink / raw)
  To: russcox, 9fans

> con: that makes it harder to simulate dos and windows.

Con? Con?!  Surely you jest?

++L



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

* Re: [9fans] memory
  2005-01-27 12:42       ` Robert Raschke
@ 2005-01-28 10:03         ` arisawa
  0 siblings, 0 replies; 14+ messages in thread
From: arisawa @ 2005-01-28 10:03 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Just translation from Robert, avoiding zero division.

#!/bin/rc
all=`{cat /dev/swap | sed 's,/, ,g'}
echo '
pageinmb = 4096/(1024*1024)
mem = '$all(1)^'*pageinmb
memtotal = '$all(2)^'*pageinmb
memperc = mem*100/memtotal
swap = '$all(4)^'*pageinmb
swaptotal = '$all(5)^'*pageinmb
if(swaptotal != 0){
         swapperc = swap*100/swaptotal
} else {
         swapperc = 0
}
print "memory: ",int(mem),"MB used (",int(memperc),"% of 
",int(memtotal),"MB).\n"
print "swap: ",int(swap),"MB used (",int(swapperc),"% of 
",int(swaptotal),"MB).\n"
' | hoc


Kenji Arisawa



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

* Re: [9fans] memory
  2005-01-27  1:05     ` andrey mirtchovski
@ 2005-01-27 12:42       ` Robert Raschke
  2005-01-28 10:03         ` arisawa
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Raschke @ 2005-01-27 12:42 UTC (permalink / raw)
  To: 9fans

After Andrey sent round his useful little script recently, I tarted
it up ever so slightly to show percentages, and since I only think in
MB these days, added some truncating:

cpu% cat /bin/mem
#!/bin/rc

# show available and used memory in
# user-discernible format.

# Thanks goes to Andrey Mirtchovski for the original.

all=`{cat /dev/swap | sed 's,/, ,g'}

pageinmb = `{echo '4096/(1024*1024)' | hoc }

mem = `{echo 'int('^$all(1)^'*'^$pageinmb^')' | hoc }
memtotal = `{echo 'int('^$all(2)^'*'^$pageinmb^')' | hoc}
memperc = `{echo 'int('^$mem^'*100/'^$memtotal^')' | hoc}
swap = `{echo 'int('^$all(4)^'*'^$pageinmb^')' | hoc }
swaptotal = `{echo 'int('^$all(5)^'*'^$pageinmb^')' | hoc}
swapperc = `{echo 'int('^$swap^'*100/'^$swaptotal^')' | hoc}

echo 'memory: '^$mem^' MB used ('^$memperc^'% of '^$memtotal^' MB).'
echo 'swap: '^$swap^' MB used ('^$swapperc^'% of '^$swaptotal^' MB).'

cpu% mem
memory: 37 MB used (42% of 87 MB).
swap: 0 MB used (0% of 512 MB).
cpu%

Robby



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

* Re: [9fans] memory
  2005-01-27  0:45   ` geoff
@ 2005-01-27  1:05     ` andrey mirtchovski
  2005-01-27 12:42       ` Robert Raschke
  0 siblings, 1 reply; 14+ messages in thread
From: andrey mirtchovski @ 2005-01-27  1:05 UTC (permalink / raw)
  To: 9fans

i find the following useful.  i'm lazy and i'm not good at multiplying
by blocksize in my head :)

	plan9% cat /bin/mem
	#!/bin/rc
	
	# show available and used memory in
	# user-discernible format.
	
	all=`{cat /dev/swap | sed 's,/, ,g'}
	
	# 4096/(1024*1024)
	pageinmb=0.00390625 
	
	mem = `{echo $all(1)^'*'^$pageinmb | hoc }
	memtotal = `{echo $all(2)^'*'^$pageinmb | hoc}
	swap = `{echo $all(4)^'*'^$pageinmb | hoc }
	swaptotal = `{echo $all(5)^'*'^$pageinmb | hoc}
	
	echo memory: $mem MB used. $memtotal MB total
	echo swap: $swap MB used. $swaptotal MB total
	
	plan9% 

it helps those times when one has forgotten to turn on the swap or is
using only 16 megs of ram instead of the available 128 :)

it output looks like this on plan9.ucalgary.ca (10000 blocks fossil cache):

	plan9% mem
	memory: 126.6640625 MB used. 430.27734375 MB total
	swap: 0 MB used. 611.76953125 MB total
	plan9% 



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

* Re: [9fans] memory
  2005-01-27  0:17 ` Tim Newsham
@ 2005-01-27  0:45   ` geoff
  2005-01-27  1:05     ` andrey mirtchovski
  0 siblings, 1 reply; 14+ messages in thread
From: geoff @ 2005-01-27  0:45 UTC (permalink / raw)
  To: 9fans

Actually, that's: any setting higher than 90% will revert to the
default (at least on the PC): the code computes userpcnt as 100 -
kernelpercent, and then works with userpcnt.

I'm using *kernelpercent=9 on my terminal, which has 1GB of RAM (for
building CD images in memory).  90MB seems to be adequate for kernel
memory.  Kernel memory is allocated primarily for images (in terminal
kernels) and network buffering.  One might want more network buffering
for faster interfaces, though back- pressure probably limits how much
memory one can profitably use.  I do like not having to worry about
running out of image memory at awkward times (the screen is populated
with windows and you try to open one more, only to have it fail and
spew complaints across the screen).


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

* Re: [9fans] memory
  2005-01-26 10:07 cej
  2005-01-26 10:58 ` Heiko Dudzus
@ 2005-01-27  0:17 ` Tim Newsham
  2005-01-27  0:45   ` geoff
  1 sibling, 1 reply; 14+ messages in thread
From: Tim Newsham @ 2005-01-27  0:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Memory test: 393216K OK,

> 58612 free pages, 234448K bytes, 874448K swap

The value that plan9 prints is the number of pages for
the paging system.  This is after memory is taken away
for the kernel itself and the kernel heap.  The amount
that is reserved for kernel vs. user space is configurable
in the pc kernel witht he "*kernelpercent" argument
(see plan9.ini(8)).  If unspecified it will default to
between 40% and 70% of memory going to userspace.  This
seems like a lot of reserved kernel memory to me on
large memory systems (such as yours), but I dont know
all of the implications of using a very low kernel percent.
Btw, any setting lower than 10% will revert to the default.

> ++pac.

Tim N.


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

* Re: [9fans] memory
  2005-01-26 10:07 cej
@ 2005-01-26 10:58 ` Heiko Dudzus
  2005-01-27  0:17 ` Tim Newsham
  1 sibling, 0 replies; 14+ messages in thread
From: Heiko Dudzus @ 2005-01-26 10:58 UTC (permalink / raw)
  To: 9fans

> at boottime Bios says:
> Memory test: 393216K OK,
> while Plan9 boot:
> 58612 free pages, 234448K bytes, 874448K swap
> (the same says Andrey's 'mem' script)
>  
> what's the matter?

I think, Plan 9 announces the free memory after occupying memory for
the kernel.

Plan 9 preserves more memory for the kernel than its size is because
graphical data for draw(3) will also get stored there.  (If I
understood the paragraph about 'kernelpercent' in plan9.ini(8)
correctly)



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

* [9fans] memory
@ 2005-01-26 10:07 cej
  2005-01-26 10:58 ` Heiko Dudzus
  2005-01-27  0:17 ` Tim Newsham
  0 siblings, 2 replies; 14+ messages in thread
From: cej @ 2005-01-26 10:07 UTC (permalink / raw)
  To: 9fans

hi,
at boottime Bios says:
Memory test: 393216K OK,
while Plan9 boot:
58612 free pages, 234448K bytes, 874448K swap
(the same says Andrey's 'mem' script)
 
what's the matter?
thanks,
++pac.


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

* Re: [9fans] memory
@ 2000-11-21 13:28 presotto
  0 siblings, 0 replies; 14+ messages in thread
From: presotto @ 2000-11-21 13:28 UTC (permalink / raw)
  To: 9fans

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

I was running an 8MB system until 6 months ago.  However, it
would go into swap hell if I tried to make kernels
locally.  It was only usable because I did most things were
done on a cpu server.

With 16mb, you can still run bigger screens than 640x480x8.
at 16MB on a terminal the kernel gives 60% of the memory to
the kernel.  You can make it more still if you want by
including in plan9.ini

	*kernelpercent=90

for example, to get 90%.  Of course, that leaves precious little
for processes.

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

From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: [9fans] memory
Date: Mon, 20 Nov 2000 15:48:57 -0500
Message-ID: <20001120204900.B527B199F0@mail.cse.psu.edu>

The install, because it keeps the file system
in RAM, requires 32MB.  I've done an install on a 32MB
system and I was using pretty much all the memory.
As others have pointed out, that's mainly because
the image data is all kept in kernel memory, and the
compressed file system on the floppy is expanded
and kept in memory while being accessed.  
You could run a simple 640x480x8 terminal with
16MB, but I'm not sure how much can be done with
only 8MB.

The ATI video cards come with a wide range of
memory depending mainly on the age of the card.
Others have reported trying the Xpert98 but I don't
remember whether the reports were good or bad.

Russ

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

* Re: [9fans] memory
  2000-11-20 20:48 Russ Cox
  2000-11-20 21:04 ` Boyd Roberts
@ 2000-11-20 21:49 ` Mike Haertel
  1 sibling, 0 replies; 14+ messages in thread
From: Mike Haertel @ 2000-11-20 21:49 UTC (permalink / raw)
  To: 9fans

>The ATI video cards come with a wide range of
>memory depending mainly on the age of the card.
>Others have reported trying the Xpert98 but I don't
>remember whether the reports were good or bad.

I have Xpert 98's (both AGP and PCI) and they
work really well.


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

* Re: [9fans] memory
  2000-11-20 20:48 Russ Cox
@ 2000-11-20 21:04 ` Boyd Roberts
  2000-11-20 21:49 ` Mike Haertel
  1 sibling, 0 replies; 14+ messages in thread
From: Boyd Roberts @ 2000-11-20 21:04 UTC (permalink / raw)
  To: 9fans

From: Russ Cox <rsc@plan9.bell-labs.com>

> You could run a simple 640x480x8 terminal with
> 16MB, but I'm not sure how much can be done with
> only 8MB.

i got the 2nd release installed wih 4mb, but i
had to do it in stages; the uncompression just
took the machine out.  it did it piecemeal.

once i'd done it 4Mb was just not enough.  you
could get 8 1/2, sam and maybe a window or two.
finally it would choke.

8Mb would have been better, but i reckon 16Mb
would have been the minimum.




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

* [9fans] memory
@ 2000-11-20 20:48 Russ Cox
  2000-11-20 21:04 ` Boyd Roberts
  2000-11-20 21:49 ` Mike Haertel
  0 siblings, 2 replies; 14+ messages in thread
From: Russ Cox @ 2000-11-20 20:48 UTC (permalink / raw)
  To: 9fans

The install, because it keeps the file system
in RAM, requires 32MB.  I've done an install on a 32MB
system and I was using pretty much all the memory.
As others have pointed out, that's mainly because
the image data is all kept in kernel memory, and the
compressed file system on the floppy is expanded
and kept in memory while being accessed.  
You could run a simple 640x480x8 terminal with
16MB, but I'm not sure how much can be done with
only 8MB.

The ATI video cards come with a wide range of
memory depending mainly on the age of the card.
Others have reported trying the Xpert98 but I don't
remember whether the reports were good or bad.

Russ



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

end of thread, other threads:[~2005-02-08  5:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07  7:16 [9fans] memory tapique
2005-02-08  4:52 ` Russ Cox
2005-02-08  5:12   ` Lucio De Re
  -- strict thread matches above, loose matches on Subject: below --
2005-01-26 10:07 cej
2005-01-26 10:58 ` Heiko Dudzus
2005-01-27  0:17 ` Tim Newsham
2005-01-27  0:45   ` geoff
2005-01-27  1:05     ` andrey mirtchovski
2005-01-27 12:42       ` Robert Raschke
2005-01-28 10:03         ` arisawa
2000-11-21 13:28 presotto
2000-11-20 20:48 Russ Cox
2000-11-20 21:04 ` Boyd Roberts
2000-11-20 21:49 ` Mike Haertel

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