[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-bugs
Subject:    [osol-bugs] apparent inconsistencies in prtswap output
From:       Peter C <p.opensol () gmail ! com>
Date:       2008-10-20 14:10:22
Message-ID: 26836689.23821224537052376.JavaMail.Twebapp () sf-app1
[Download RAW message or body]

I'm looking for an explanation for some apparent inconsistencies in the output from \
the prtswap command.  There is an example of prtswap in section 6.18.7 of the Solaris \
Performance and Tools book.

I extracted prtswap from the file RMC3.9.5beta.tar.Z on the memtool download site \
http://www.solarisinternals.com/si/downloads/_memtool/.  prtswap is a ksh script that \
draws its data from the swap(1M) command and the kernel's swap accounting data \
structures.  I assume that version 3.9.5beta is the most current, but it looks like \
it hasn't been updated for a few years.

Here's the output from prtswap on a SF6800 with 8GB RAM installed and 8143MB of \
disk-based swap space.  The system is running Solaris 8, and is patch-current:

# prtswap -l

Swap Reservations:
--------------------------------------------------------------------------
Total Virtual Swap Configured:                          14490MB =
RAM Swap Configured:                                         6347MB
Physical Swap Configured:                              +     8143MB

Total Virtual Swap Reserved Against:                     7573MB =
RAM Swap Reserved Against:                                   2336MB
Physical Swap Reserved Against:                        +     5237MB

Total Virtual Swap Unresv. & Avail. for Reservation:     6917MB =
Physical Swap Unresv. & Avail. for Reservations:             2906MB
RAM Swap Unresv. & Avail. for Reservations:            +     4011MB


Swap Allocations: (Reserved and Phys pages allocated)
--------------------------------------------------------------------------
Total Virtual Swap Configured:                          14490MB
Total Virtual Swap Allocated Against:                    4535MB

Physical Swap Utilization: (pages swapped out)
--------------------------------------------------------------------------
Physical Swap Free (should not be zero!):                8143MB =
Physical Swap Configured:                                    8143MB
Physical Swap Used (pages swapped out):                -        0MB


The data in the Swap Reservations section seems credible, and after reading section \
6.18, the following relation is true:

Total Virtual Swap Reserved Against (7573MB) > Total Virtual Swap Allocated Against \
(4535MB).

But these relations in the report don't make sense to me:

1) The last line states that no pages are swapped out (Physical swap used = 0), so \
the allocated swap (4535MB) should all be in RAM.  But RAM swap reserved is 2336MB.  \
How can this be if, according to figure 6.5 on page 167, reserved swap includes \
allocated swap, unallocated swap, and used physical swap?

2) The sum of RAM swap unreserved and available for reservations (4011MB) and the \
total virtual swap allocated (4535MB), which again must all be in RAM since there are \
no pages swapped out to disk, is 8545MB.  But this is greater than the amount of RAM \
installed in the server - why?

3) I've included a run of vmstat below:

bash-2.03$ vmstat 1 10
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 s6 s1   in   sy   cs us sy id
 0 0 0 6706904 2656984 283 981 131 1 0 0 0  8  1  0  0 3082  210 2978  6  5 89
 0 0 0 7088672 1922488 0  6  0  0  0  0  0 12  0  0 11 4430 19570 6471 16 13 70
 0 0 0 7088736 1922552 0  0  0  0  0  0  0 11  4  0 12 4331 17241 6086 14 15 71
 0 0 0 7088672 1922488 0  0  0  0  0  0  0 12  0  0 11 4347 19184 6131 9 13 77
 0 0 0 7088672 1922496 0  0  0  0  0  0  0 12  0  0 11 4292 17556 6110 15 13 72
 0 0 0 7088736 1922552 0  0  0  0  0  0  0 12  0  0 12 4354 18878 6383 9 13 79
 0 0 0 7088672 1922488 0  0  0  0  0  0  0 13  0  0 12 4412 19544 6584 16 12 71
 0 0 0 7088672 1922488 0  0  0  0  0  0  0 14  0  0 12 4330 17511 6057 10 14 76
 0 0 0 7088736 1922552 0  0  0  0  0  0  0 11  0  0 11 4209 16148 5786 11 12 77
 0 0 0 7088736 1922552 0  0  0  0  0  0  0 15  0  0 14 4392 17389 6243 9 12 78

Available swap is in the range 7088672 - 7088736, or about 6922MB.   This is "close \
enough" to the value prtswap reported for total virtual swap unreserved, 6917MB.  But \
free memory, ranging from 1922488 to 1922552 or about 1877MB, is nowhere near the \
4011MB that prtswap reports is unreserved RAM swap.   

I've looked at the prtswap script and the anonymous memory structures themselves in \
the Solaris 8 header file /usr/include/vm/anon.h for explanations without success.  \
The code seems consistent with the documentation, and vice-versa.

Does anyone have any insight into these findings?

Thanks!

Peter
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-bugs mailing list
opensolaris-bugs@opensolaris.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic