From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 26 15:47:23 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B254837B404 for ; Wed, 26 Mar 2003 15:47:23 -0800 (PST) Received: from shared10.hosting.flyingcroc.net (shared10.hosting.flyingcroc.net [207.246.149.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3277E43F3F for ; Wed, 26 Mar 2003 15:47:23 -0800 (PST) (envelope-from dpk@dpk.net) Received: from shared10.hosting.flyingcroc.net (localhost [127.0.0.1]) h2QNlM8I040237 for ; Wed, 26 Mar 2003 15:47:22 -0800 (PST) Received: from localhost (dpk@localhost)id h2QNlMBX040234 for ; Wed, 26 Mar 2003 15:47:22 -0800 (PST) X-Authentication-Warning: shared10.hosting.flyingcroc.net: dpk owned process doing -bs Date: Wed, 26 Mar 2003 15:47:22 -0800 (PST) From: dpk X-Sender: dpk@shared10.hosting.flyingcroc.net To: hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-7.3 required=5.0 tests=USER_AGENT_PINE,X_AUTH_WARNING autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Subject: RFA: Keeping sysadmin programs resident/available X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2003 23:47:24 -0000 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