9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Hogan dhog@lore.plan9.cs.su.oz.au
Subject: [9fans] Plan 9 on PC - memory and swap
Date: Thu, 24 Jul 1997 03:43:55 +1000	[thread overview]
Message-ID: <19970723174355.Wny6_5fZZoSnQ7um00AF0fS-752UwzOOcx4Px02e_3A@z> (raw)

> Loading a version of 9pccpudisk, I get the following message:

> 	2531 free pages, 10124K bytes, swap 55564K, highwater 504K, headroom
> 628K

> a "cat /dev/swap" yields:

> 	641/2531 memory 0/11360 swap

> on an idle CPU/auth server.

> I've not bothered with the details before, but now I'm curious.
> Evidently, the swap value in the kernel message is displayed
> incorrectly, specially in view of the fact that swap has not been
> enabled at the time the kernel loads.

> Given that the CPU server has 16 meg of RAM, I'd also be curious as to
> why only 2531K remains available.  Pointers to reading material are
> welcome.

The numbers in /dev/swap are in units of pages, and on a PC
the page size is 4K.  [Aside: why is there no /dev/pagesize?]

So, 2531 * 4K = 10124K, ie of the 16M that you have, 10M is
available for user processes.  The other 6M is kept by
the kernel for its text and data space, in-kernel bitmap
storage, scsi and ethernet buffers, stream blocks, etc etc...

According to /dev/swap you have 11360*4K = 45440K available
for swap.  If you add 10124K, you get 55564K, the value printed
at startup.  This number represents the total amount of
virtual memory available when swapping is enabled (and
when the swap partition is >= BY2PG*conf.nswap).  See
pageinit() in /sys/src/9/port/page.c, where the message
is printed...




             reply	other threads:[~1997-07-23 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-23 17:43 David [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-07-23 13:05 Lucio

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=19970723174355.Wny6_5fZZoSnQ7um00AF0fS-752UwzOOcx4Px02e_3A@z \
    --to=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).