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

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
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?

kevin lyda kevin+dated+1033892092.a8d043 at ie.suberic.net
Tue Oct 1 09:15:03 IST 2002


On Tue, Oct 01, 2002 at 09:04:05AM +0100, Niall O Broin wrote:
> On Mon, Sep 30, 2002 at 09:03:06PM +0100, Kenn Humborg wrote:
> > 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
>     	  data = ptrace(PTRACE_PEEKTEXT, pid, word, 0);
> 	  word++
>     end
> end
> 
> is going to touch every page, and if anything gets swapped back out, it will
> be the earlier processes including mingettys etc. My logic falls down
> slightly when you need to consider PID wraparound but damn it, I'm just
> rambling here - you want a full & correct solution, email me for a quote :-)

i dunno, i think i'd write a c program that would take a pid as an arg
and do the ptrace thing on that pid.  then i'd write a perl program to
walk pid's in /proc that would use a regex to weed out procs by peeking
in /proc/<pid>/cmdline.  seems pretty simple really.

kevin

-- 
kevin at ie.suberic.net          "How do we know Saddam has weapons of mass
fork()'ed on 37058400          destruction?  We looked at the receipt."
meatspace place: home                                    --Bill Hicks
http://ie.suberic.net/~kevin



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