home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!usc!sdd.hp.com!hp-cv!hp-pcd!hpfcso!ajs
- From: ajs@hpfcso.FC.HP.COM (Alan Silverstein)
- Newsgroups: comp.sys.hp
- Subject: Re: What does sw_nfpgs really represent?
- Message-ID: <7371255@hpfcso.FC.HP.COM>
- Date: 25 Aug 92 19:32:11 GMT
- References: <1992Aug19.054613.8198@novatel.cuc.ab.ca>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Lines: 31
-
- > The question is, what does the value sw_nfpgs **really** represent...
- > The rest of the parameters seem to agree with what comes from
- > /usr/sam/bin/swapinfo.
-
- My best understanding, as author of swapinfo(1M) (available on 8.07 and
- later):
-
- For device swap, sw_nfpgs is the number of free pages in the device swap
- area (can be a whole disk (on S800, a whole partition) or follow a file
- system (S300/400/700 only?)). Convert to bytes using the constant NBPG
- (which can change from one release to another?). (My uncertainty is
- just because it's been awhile and I don't have time to re-research.)
-
- Since swap space is always taken in swchunk increments (2Mb or 4Mb by
- default depending on Series), some device swap space is not usable.
- Swapinfo computes as follows (more or less, this is an excerpt):
-
- avail_bytes = swapentry.sw_nblks * DEV_BSIZE;
- wasted_bytes = avail_bytes % swchunk_bytes;
- free_bytes = swapentry.sw_nfpgs * NBPG;
- used_bytes = avail_bytes - free_bytes;
-
- Hence wasted_bytes always appear "used" not "free".
-
- Now, fsw_nfpgs for file system swap is different, but you didn't ask
- about that. :-)
-
- This response does not represent the official position of, or statement
- by, the Hewlett-Packard Company. The above data is provided for
- informational purposes only. It is supplied without warranty of any
- kind.
-