tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Randy M. Hayman" <haymanr () icefog ! sois ! alaska ! edu>
To: tru64-unix-managers
Subject: Summary: Digital UNIX v4.0B & swap
Date: Thu, 24 Apr 1997 00:28:43 +0000	[thread overview]
Message-ID: <96078611110638.tru64-unix-managers.marc@archive.invalid> (raw)

My own resolution and summary:

Earlier today I posted:

|>I have some code which is supposed to get swap file usage information, though
|>I am getting some discrepencies (any clues as to why?):
|>
|>code snippet:
|>
|>#include <sys/table.h>
|>struct  tbl_swapinfo    t_swapinfo;
|>
|>swap_info(void)
|>{
|>    if( 0 > (table(TBL_SWAPINFO, -1, &t_swapinfo, 1, sizeof(t_swapinfo))) )
|>        fprintf(stdout, "Can't get swap device information.\n");
|>
|>    abort();	/* dump core for me argentina */
|>}
|>
|>(dbx) p t_swapinfo
|>struct {
|>    flags = 1
|>    size = 112306 <<<<<<<<<<<<< size (pages)
|>    free = 93973  <<<<<<<<<<<<< free (pages)
|>    dev = 8389633
|>    ino = 0
|>}
|>
|>
|>swapon -s output from the same instant in time:
|>
|>Swap partition /dev/rz1b (default swap):
|>    Allocated space:        16896 pages (132MB)
|>    In-use space:            5787 pages ( 34%)
|>    Free space:             11109 pages ( 65%)
|>
|>Swap partition /dev/rz3g:
|>    Allocated space:        95410 pages (745MB)
|>    In-use space:            5517 pages (  5%)
|>    Free space:             89893 pages ( 94%)
|>
|>
|>Total swap allocation:
|>    Allocated space:       112306 pages (877MB) <<<<<<<<< size
|>    Reserved space:         17017 pages ( 15%)
|>    In-use space:           11304 pages ( 10%)
|>    Available space:        95289 pages ( 84%)  <<<<<<<<< free
|>
|>
|>So, why the discrepency?  It doesn't matter if I'm using immediate or deferred
|>mode swapping, or if I have one or more swap partitions - apparently the
|>tbl_swapinfo table isn't getting updated as I expect.


Well, interestingly enough the swapon code is doing pretty much the identical 
thing my code snippet is, perhaps this means I should believe both swapon
and my code and that my system has moderately active swapping such that I
can't generate the exact results since I can't run both codes exactly
simultaneously.

Randy Hayman
haymanr@icefog.alaska.edu

                 reply	other threads:[~1997-04-24  0:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox