Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2003 15:47:22 -0800 (PST)
From:      dpk <dpk@dpk.net>
To:        hackers@freebsd.org
Subject:   RFA: Keeping sysadmin programs resident/available
Message-ID:  <Pine.BSF.4.21.0303261541490.61858-100000@shared10.hosting.flyingcroc.net>

next in thread | raw e-mail | index | archive | help
Hi all,

I was wondering if anyone here knows of a way to force specific programs
to stay resident (not swap) - specifically, I'm trying to see if there's a
way one could keep sshd out of swap, and then execute a shell and some
basic sysadmin tools (ps, top, etc), with the same swap-prevention, so
when an end-user inevitably runs a system out of swap certain processes
would still be available. (I'm thinking that it'd only need a few MB
reserved, so the impact to the system would be minimal).

So far my search has led me to mlock(), which seems to work on address
ranges. In my tests I haven't actually been able to prevent pages from
swapping, but I was able to cause the RSS of a test binary to grow by
modifying rtld to mlock() everything it mmap()s. Obviously I'm grasping at
straws there - idealy the solution would work on static executables as
well.

I've also heard of madvise - same results.

Has anyone here dealt with this issue? Any tips/leads I could follow?

- dpk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0303261541490.61858-100000>