HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

swapinfo memory line

 
SOLVED
Go to solution
gnaid
Occasional Contributor

swapinfo memory line

I'm a little confused on the swapinfos memory line
According to swapinfo man page:
...
memory Memory paging area (also known as pseudo-swap).
This is the amount of system memory that can be
used to hold pages in the event that all of the
above paging areas are used up. See "Paging
Allocation" below. This line appears only if
memory paging is enabled.
...


BUT on my system:
# model
ia64 hp server rx2620
# uname -a
HP-UX hpsrv3 B.11.31 U ia64

# dmesg | grep Physical
Physical: 2085612 Kbytes, lockable: 1339168 Kbytes, available: 1507160 Kbytes

# swapinfo -tm
swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4194304 0 4194304 0% 0 - 1 /dev/vg00/lvol2
reserve - 302004 -302004
memory 1984012 552236 1431776 28%
total 6178316 854240 5324076 14% - 0 -


AVAILABLE MEMORY is 1507160 Kbytes and the size of pseudo-swap should be set at 7/8 of the Available memory at system startup time,which is definitely not 1984012.

On the other hand HP-UX CSE Official Study Guide and Desk Reference, ISBN : 0-13-146396-9 says "The memory line lists the amount of pseudo-swap configured. Also note that the usage on the memory line includes usage by other kernel subsystems and not just pseudo-swap." (9.3 Configuring Additional Swap Devices
)

Which is right?!
11 REPLIES

Re: swapinfo memory line

>swapinfo -t

(I would suggest you always use -tam because K is just too small a unit.)

>AVAILABLE MEMORY is 1507160 Kbytes and the size of pseudo-swap should be set at 7/8 of the Available memory

I think available memory for swapinfo is total memory. But that still gives 95% of your 2 Gb.

I would suggest you shouldn't worry about the value of the avail memory line of swapinfo. What you get is what it is.

swapinfo(1m) says:
For the memory paging area this value is also not necessarily constant, because it reflects allocation of memory by the kernel as well as by processes that might need to be paged.
gnaid
Occasional Contributor

Re: swapinfo memory line

10x Dennis,
I don't worry about the value, just wondering...

swapinfo(1m) is too old(and may be there are some errors). For example:

"2.

If all file system paging areas are completely allocated and the request is still not satisfied, the system will try to use memory paging as described on the memory line above. (Memory paging is controlled by the tunable parameter swapmem_on, which defaults to 1 (on). If this parameter is turned off, the memory line will not appear.)"

- This is HP-UX v3 and swapmem_on is not tunnable.
- My device/file system paging areas are not allocated at all, but the system uses memory paging?!(according to my memory line above).

It's look like the memory line is completely useless, and I really don't know how to interpret it( as far as I don't have the source).

and what is worse I haven't info about the pseudo-swap

Re: swapinfo memory line

>It looks like the memory line is completely useless

No, it tells you how much is used and how much is free.
gnaid~
Occasional Advisor

Re: swapinfo memory line

ok,

total(avail) = dev(avail) + memory(avail)

=> memory is the pseudo-swap (it is a part of the total swap )

I still don't know how the size of pseudo-swap is calculated.
Steven E. Protter
Exalted Contributor

Re: swapinfo memory line

Shalom,

Memory to HP-UX is ram plus swap.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
gnaid~
Occasional Advisor

Re: swapinfo memory line


> => memory is the pseudo-swap (it is a part of the total swap )

I mean the swapinfo's "memory line" ;)
Don Morris_1
Honored Contributor

Re: swapinfo memory line

v3 does not use the 7/8ths calculation -- it calculates maximum swap mem using a heuristic instead. (The default is roughly 90% of total physical memory available at the time of setting up User process reservation space.).

Frankly -- your numbers make no sense as given. Your memory line is 95% of total physical, not available. Possible, but highly unlikely without tweaking the heuristic -- which isn't something that is/should be done externally. When you add in that the available memory was only 1507160 kB, however -- it makes even less sense.

So -- given all that, I'm suspicious as to if you've done a Memory OLA operation. [This is part of why dmesg is *not* a reliable way to get your physical memory].

First, compile and run the attached program so we can see where the system is at now. If the reported physical memory is higher than your dmesg, you know you had Memory OLA. To find out when, I'd probably do:

evmget -A -t "@timestamp @@"

but then again, I'm not terribly perfect with awk and friends so I know I generate a bunch of data to slog through some times.
An alternate approach is to check the syslog for a Memory Class line after boot (VM will issue one on every Memory OL* success such that the updated Physical/Lockable/Swapmem totals are known for each Memory Class [System as a whole, Kernel Only, User Only]).
gnaid~
Occasional Advisor

Re: swapinfo memory line

10x Don,
no Memory OLA (btw, rx2620 is a low entry server and don't support OL* functionality )

[root@hpsrv3 /]# dmesg | grep Physical
Physical: 2085612 Kbytes, lockable: 1339168 Kbytes, available: 1507160 Kbytes

[root@hpsrv3 /]# ./335520 (your script!)
Memory Stat total used avail %used
physical 2036.7 994.6 1042.1 49%
active virtual 483.1 321.1 161.9 66%
active real 248.1 156.2 92.0 63%
memory swap 1937.5 539.4 1398.1 28%
device swap 4096.0 297.6 3798.4 7%
Activations: 0 total, 0 rate. Deactivations: 0 total, 0 rate.
Reclaims from Swap: 0 total (Up 0), 0 rate.

[root@hpsrv3 /]# swapinfo -tm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 299 -299
memory 1938 540 1398 28%
total 6034 839 5195 14% - 0 -



This is another rx2620 machine (both are real systems with the same hp-ux v3, not VM) :
dmesg | grep Physical
Physical: 2085612 Kbytes, lockable: 1325676 Kbytes, available: 1500560 Kbytes
[root@hpsrv4 /]# swapinfo -tm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 2048 0 2048 0% 0 - 1 /dev/vg00/lvol2
reserve - 414 -414
memory 1938 585 1353 30%
total 3986 999 2987 25% - 0 -
gnaid~
Occasional Advisor

Re: swapinfo memory line

Memory class line after boot:
(/var/adm/syslog/syslog.log)

Jun 3 17:43:50 hpsrv3 vmunix: Memory Class Setup
Jun 3 17:43:50 hpsrv3 vmunix: -------------------------------------------------------------------------
Jun 3 17:43:50 hpsrv3 vmunix: Class Physmem Lockmem Swapmem
Jun 3 17:43:50 hpsrv3 vmunix:
Jun 3 17:43:50 hpsrv3 above message repeats 2 times
Jun 3 17:43:50 hpsrv3 vmunix: System : 1937 MB 1937 MB 1937 MB
Jun 3 17:43:50 hpsrv3 vmunix: Kernel : 1937 MB 1937 MB 1937 MB
Jun 3 17:43:50 hpsrv3 vmunix: User : 1484 MB 1315 MB 1320 MB

and memory info:
Jun 3 17:43:50 hpsrv3 vmunix: Memory Information:
Jun 3 17:43:50 hpsrv3 vmunix: physical page size = 4096 bytes, logical page size = 4096 bytes
Jun 3 17:43:50 hpsrv3 vmunix: Physical: 2085612 Kbytes, lockable: 1339168 Kbytes, available: 1507160 Kbytes
Don Morris_1
Honored Contributor
Solution

Re: swapinfo memory line

Got it -- brain slipped a minor gear.

The algorithm I mentioned (90% of available) is correct and is used to configure *User* memory swap maximums.

The System-wide memory swap maximum, however, is all the memory which is reserveable at all. (Since the kernel is allowed to lock everything it can, etc.). Hence the total line reflects the *System* Memory Reservation class and is tied solely to the amount of physical memory which is present and given to the reservation management layer. pstat reports the system state, not the maximum available to the calling process [which, mind you could be different if products like WLM are in play].

Which in practice on v3 means all RAM that isn't PFDATs. PFDATs are about 5% -- hence the 95% seen here. The available line for the system will be lower and reflects the early boot usage (and then becomes lower still as User and Kernel start normal operation and reservation).
gnaid
Occasional Contributor

Re: swapinfo memory line

hi Don,
I'm still not 100% sure,but it seems you are right ;)
All RAM that isn't PFDATs works now as pseudo-swap...

/I suppose swapinfo uses the same pst_vminfo struct, .psv_swapmem_max ,etc. /


And only 4 info:
About reported pseudo-swap usage even when no physical swap has been allocated.
---------
HP-UX 11i Internals,ISBN : 0-13-032861-8 , 2004!, Chapter 7(Pseudo swap,Interpreting the Output of swapinfo):
"When a process starts, its swap space requirements are calculated and reserved. As long as there is device or file system swap space available to cover this reservation, all is fine. Once we exceed the physical swap limit, we begin to allocate from the pseudo-swap area.

...
If you run the swapinfo command and have pseudo-swap enabled, you will see a line that reports the amount of memory swap available and the amount currently in use. Don't be surprised if pseudo-swap usage is reported even when no physical swap has been allocated. Since pseudo-swap is letting us cheat the limit, the system must be able to adjust this cheat as the kernel takes dynamic pages out of circulation, effectively reducing the available memory count. Therefore, the system reports these kernel-allocated pages as allocated pseudo-swap pages. This effectively reduces the swap reservation limit available and keeps the system from overcommitting its memory resource."