LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] "Swap-in" tool?

[ILUG] "Swap-in" tool?

Niall O Broin niall at linux.ie
Tue Oct 1 13:08:02 IST 2002


On Tue, Oct 01, 2002 at 09:50:17AM +0100, Kenn Humborg wrote:

> > swapped but rather paged, hence they don't get put into swap ? I'm not
> > familiar enough with how Linux handles paging/swapping to know
> > what it does
> > in that area.
> 
> Yes.  Unmodified code pages are backed by the executable file itself.
> They never find their way to swap.  All modern OSes that I've looked
> at (Linux, NT, VMS) do this.

OK - I've an idea this could be different in earlier Unices (via the sticky
bit) but that behaviour seems more sensible.

> 
> > > And ptrace() lets me be selective about which processes I want
> > to be resident.
> > > No need to page in a bunch of mingettys!
> >
> > Well, yes, but really, are you going to bother ? When something
> > as simple as
> >
> > for pid = 2 to PID_MAX
> >     word = 0
> >     while not errno
>       ^^^^^^^^^^^^^^^
> 
> Probably won't work because virtual address space is not contiguous.
> I'll need to look at /proc/PID/maps to get the list of valid regions.

Well you live and learn. Not something I've ever looked at before (it's been
a LONG time since I programmed in anything which specified numeric
addresses) but I sort of assumed that a programs VM would just be addressed
from 0-end, with the mapping to real addresses handled by the processor. A
little though about the return value of a malloc of course would have made
it obvious that this isn't true. And then a quick cat of
/proc/somerandompid/maps made me think that there's very little wrong with
the swap frobbing idea :-)



Niall  "If TMTOWTDI I'll take the easier(st) one thanks"  O Broin



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell