swapfs questions

swapfs questions

Post by 0000-Admin(00 » Sat, 07 Jan 1995 04:07:16



A few questions.  Thanks for any help.

1)  If I put my physical disk backing for swap on seperate devices,  will Solaris 2.3 be able to use
    them concurrently, or will it simply fill them up sequentially?

2) I have noticed in Answerbook and in class notes that examples of swap -l on solaris 2.3 systems
   show an entry for swapfs, and then show the disk backing partitions.  Additionally, in
   /var/adm/messages they show that swap is allocated on swapfs.  I get no such information on
   my systems.  swap -l only shows the disk partitions, and there is no message in /var/adm/messages.
   Am I setting swap up incorrectly??  My /etc/vfstab looks like the examples, so I am confused.

3) We have an application that does a monstrous amount of loading application code into memory on
   a continual basis.  This causes heavy pagein activity and an ungodly amount of io to the swap
   disk.  Is there a way to achieve the pageins without such heavy io on the swap disk??

 
 
 

swapfs questions

Post by Casper H.S. D » Sat, 07 Jan 1995 06:16:06



>A few questions.  Thanks for any help.
>1)  If I put my physical disk backing for swap on seperate devices,  will Solaris 2.3 be able to use
>    them concurrently, or will it simply fill them up sequentially?

The devices are filled up evenly.  All devices are filled with an
equal number of blocks until the smallest is full, etc.
You can check this with swap -l.  

Quote:>2) I have noticed in Answerbook and in class notes that examples of swap -l on solaris 2.3 systems
>   show an entry for swapfs, and then show the disk backing partitions.  Additionally, in
>   /var/adm/messages they show that swap is allocated on swapfs.  I get no such information on
>   my systems.  swap -l only shows the disk partitions, and there is no message in /var/adm/messages.
>   Am I setting swap up incorrectly??  My /etc/vfstab looks like the examples, so I am confused.

In Solaris 2.2 and earlier the first entry listed by "swap" was the
virtual "swapfs" filesystem.  That is the total of memory & disk
used for swap.  Apparently swapctl in 2.3 no longer returns "swapfs"
as one of the swap filesysytems. But is only a virtual filesystem
which is always used for swap.

Quote:>3) We have an application that does a monstrous amount of loading application code into memory on
>   a continual basis.  This causes heavy pagein activity and an ungodly amount of io to the swap
>   disk.  Is there a way to achieve the pageins without such heavy io on the swap disk??

Application code (instructions) are not pages to swap.  They're paged
in from disk.

(And keep your lines < 75)

Casper

 
 
 

swapfs questions

Post by Ruth Miln » Sun, 08 Jan 1995 03:44:15




Quote:

>You can check this with swap -l.  

Speaking of checking swap :-) ...

This is going to be long, but it illustrates a real problem (maybe it's
a bug, but I've never seen a patch described for it). I have noticed that
swap -l and swap -s never agree with each other, even after doing various
arithmetic manipulations with free memory, etc.

E.g., on a system with 128MB real memory (vmstat showing 7MB free) and
300MB swap, here's what I get:
-------------
# swap -s
total: 188352k bytes allocated + 36200k reserved = 224552k used, 165368k
   available

# swap -l
swapfile                   dev  swaplo blocks   free
/dev/dsk/c0t3d0s1         32,25      8 403192 230104
/export/home/swap/swapfile  -        8 204792  51328

# vmstat 2
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s1 s1 s1 s1   in   sy   cs us sy id
[...]
 0 0 0 165348  7220   0   0 92  0 12  0  9  0 78  0  0  574  431  207  8 10 82
-------------

swap -s has to be including some real memory, otherwise it couldn't get to
225+165=390MB total "swap". And so must vmstat, top, and proctool, which
all agree with the 165MB free swap, and all purport to show 7MB free memory
separately as well. On the other hand, 300+128 > 390, so it can't be
including all memory, either. Why isn't swap -s consistent about counting
real memory in its figures?

By contrast, swap -l thinks there is only 140MB free swap (it consistently
reports lower numbers than swap -s). If I take the amount used that swap -l
suggests (300-140=160MB), and add it to the 165MB "free" from vmstat, I get
325MB, which is more swap than there actually is. Even if I first subtract
the supposed 7MB free memory from the 165 number (in case it means "free
virtual", not "free swap"), it still comes out to 318.

So which, if any, of these numbers are right? Is there another 18MB free
memory that vmstat and friends aren't reporting? Or another 38MB (428-390)?
Or ~64MB total (the 225 used that swap -s reports, minus the 160 used that
swap -l claims, subtracted from 128MB total memory)?

No contortions, logical or otherwise :-), that I can think of make these
numbers add up. It would be annoying enough to go through this if they did,
but they never do. How much of this can be trusted, and is there any way
to get the true story? I'd really appreciate knowing; I have a few users
who would like to see how they're using their system, and telling them
"well this kind of gives you an idea but don't trust it completely" just
doesn't cut it.

Thank you, and apologies for the long article!
--
Ruth Milner                            NRAO                  Socorro NM

 
 
 

swapfs questions

Post by Adrian Cockcroft - SMCC Product Marketing Engineeri » Sun, 08 Jan 1995 11:51:56


If you convert the sar values from blocks (512 bytes) to KB you should find.

(swap -s available) + (swap -s reserved) = (sar -r freeswap)

i.e. reserved swap is still free, because it has not been written to,
although the system knows that it might need to write that much data out
to swap.

----------- your example ------
# swap -s
total: 188352k bytes allocated + 36200k reserved = 224552k used, 165368k
   available

# swap -l
swapfile                   dev  swaplo blocks   free
/dev/dsk/c0t3d0s1         32,25      8 403192 230104
/export/home/swap/swapfile  -        8 204792  51328
-----------

165368k + 36200k = (230104 + 51328 blocks + "some" RAM)

201568k = 140716k + RAM, so there is 60852k of RAM contributing to swap space

vmstat free has nothing to do with it. There is a white paper called
"Virtual Swap Space in SunOS" by Howard Chartock and Peter Snyder that explains
how parts of RAM are used to increase the effective swap space.

I know this is confusing, I tried to explain it in my book...

If you use the number vmstat reports for available swap, then when it reaches 0
the system stops working :-)

Regards Adrian

---

SMCC Product Marketing Engineering - Phone 415 336 0615 - Fax 415 336 0648
Sun Microsystems, 2550 Garcia Avenue, Mountainview, CA 94043, USA


>E.g., on a system with 128MB real memory (vmstat showing 7MB free) and
>300MB swap, here's what I get:
>-------------
># swap -s
>total: 188352k bytes allocated + 36200k reserved = 224552k used, 165368k
>   available

># swap -l
>swapfile                   dev  swaplo blocks   free
>/dev/dsk/c0t3d0s1         32,25      8 403192 230104
>/export/home/swap/swapfile  -        8 204792  51328

># vmstat 2
> procs     memory            page            disk          faults      cpu
> r b w   swap  free  re  mf pi po fr de sr s1 s1 s1 s1   in   sy   cs us sy id
>[...]
> 0 0 0 165348  7220   0   0 92  0 12  0  9  0 78  0  0  574  431  207  8 10 82
>-------------

>swap -s has to be including some real memory, otherwise it couldn't get to
>225+165=390MB total "swap". And so must vmstat, top, and proctool, which
>all agree with the 165MB free swap, and all purport to show 7MB free memory
>separately as well. On the other hand, 300+128 > 390, so it can't be
>including all memory, either. Why isn't swap -s consistent about counting
>real memory in its figures?

>By contrast, swap -l thinks there is only 140MB free swap (it consistently
>reports lower numbers than swap -s). If I take the amount used that swap -l
>suggests (300-140=160MB), and add it to the 165MB "free" from vmstat, I get
>325MB, which is more swap than there actually is. Even if I first subtract
>the supposed 7MB free memory from the 165 number (in case it means "free
>virtual", not "free swap"), it still comes out to 318.

>So which, if any, of these numbers are right? Is there another 18MB free
>memory that vmstat and friends aren't reporting? Or another 38MB (428-390)?
>Or ~64MB total (the 225 used that swap -s reports, minus the 160 used that
>swap -l claims, subtracted from 128MB total memory)?

>--
>Ruth Milner                            NRAO                  Socorro NM


 
 
 

swapfs questions

Post by Matus Uhlar Softwa » Thu, 12 Jan 1995 17:50:50


: swap -s has to be including some real memory, otherwise it couldn't get to
: 225+165=390MB total "swap". And so must vmstat, top, and proctool, which
: all agree with the 165MB free swap, and all purport to show 7MB free memory
: separately as well. On the other hand, 300+128 > 390, so it can't be
: including all memory, either. Why isn't swap -s consistent about counting
: real memory in its figures?

don't forget that /tmp is mounted on swap, so some files takes some place
on swap...

--
Matus Uhlar (Fantomas on IRC),
Computer Centre of Technical University in Kosice, Slovakia

 
 
 

1. olaris 2.1 swapfs question

For vm gurus's only: Reading from swap space, from userland

According to the swap man page, swapfs is a virtual swap device
consisting of all physical memory and swap storage. I am trying
to read from another process space which exists on this device.

When a page is on a normal swap device, you can find the data by
finding the segment's segvn structure, reading the anon_map, finding
the anon structure and locating the vnode and offset.

If this vnode is a device vnode, it can be opened and read at that
offset, but if this vnode is the swapfs vnode, it has no device
(its marked ISSWAP).  Does this mean that the page is in memory and
not on a swap device yet?  If that is so, I would assume that you have
to find the page structure via the hash lookup, is this true?

If not, what would you suggest finding it?

P.S. It used to be easier on SunOS, because the anon structure had
a pointer to the page structure if it wasn't swapped out.

Thanks for the help,

+------------------------------------------------------------------------+
| Steve Sonnenberg   [Too busy to do anything fancy or cute, Sorry]      |
| Landmark Systems Corp.       3402 Shelburne Rd, Baltimore, MD 21208    |

| Phone:  410-764-0454;  Fax: 410-358-2106;  Pager: 410-938-1612         |
+------------------------------------------------------------------------+

2. YDL 1.2 - CD Player not working

3. swapfs ?

4. Complete Linux Newbie...HELP!!!! Linux machine on network with Win98 Machines

5. swapfs system call

6. DNS - Some resolve, some don't!

7. Thoughts on tmpfs and swapfs

8. ``Cannot handle paging request'' w/ 0.99pl9 & Nothing fancy

9. pseudo filesystem: tmpfs vs swapfs

10. Mini-Linux Distribution Questions + General Questions + UMSDOS Questions

11. Questions, questions questions

12. 3 issues --- 1-Gnome Question, 2-CDRom Detect Question, 3-IMLIB Question

13. Questions Questions Questions ???