From owner-freebsd-hackers Sat Sep 29 15:56:57 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id D1EB737B40E for ; Sat, 29 Sep 2001 15:56:53 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id D5BD081D06; Sat, 29 Sep 2001 17:56:53 -0500 (CDT) Date: Sat, 29 Sep 2001 17:56:53 -0500 From: Alfred Perlstein To: Vladimir Dozen Cc: Matt Dillon , Wilko Bulte , hackers@FreeBSD.ORG Subject: Re: VM: dynamic swap remapping (patch) Message-ID: <20010929175653.Z59854@elvis.mu.org> References: <20010929155941.A291@eix.do-labs.spb.ru> <20010929071024.Q59854@elvis.mu.org> <20010929141349.A80876@freebie.xs4all.nl> <200109291653.f8TGrRR37689@earth.backplane.com> <20010929232953.B341@eix.do-labs.spb.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010929232953.B341@eix.do-labs.spb.ru>; from vladimir-dozen@mail.ru on Sat, Sep 29, 2001 at 11:29:53PM +0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Vladimir Dozen [010929 14:38] wrote: > P.S. Anyway, I do NOT insist my solution is better, and even that it > is good for anything at all. It was fun for me to hack in BSD kernel, > and it was interesting challenge, and I feel need to share results > with others. At worst, I will recommend our customer to setup > processing farm under FreeBSD with applied patch. I'm really impressed with the work you put into this, but it seems that you've tried to tackle two problems at the same time, and by tying them together made it less flexible and possibly more error prone. My suggestion, (but not my final say, i'm still open to ideas): Implement a memory status signal to notify processes of changes in the relative amount of system memory. When memory reaches a low or high watermark, the signal is broadcast to all running processes. The default disposition will be to ignore the signal. The signal will be named SIGMEMINFO. (SIGXfoo means 'process has exceeded resource foo') The signal will pass via the siginfo struct information such that the process can determine if the system has just exceeded the low watermark (danger) or has reclaimed down to the high watermark (enough free memory). This is just to provide processes with a warning to scale back consumption, exit, or release reasources, the good part is that it's broadcast and all interested parties will do something, hopefully the right thing. To achieve nearly the same effect as your patch, I would implement the above low/high water mark notification, then either: a) over allocate swap a bit and set the low watermark carefully. b) do the following enhancement: Provide a system whereby you can swap to the filesystem without additional upcalls/syscalls from userspace, basically, provide some means of paging to the filesystem automatically. then, set your lowwater mark to the size of your swap partition, now your system will alert your processes and automatically swap _anyone_ to the filesystem. I really think that this would be more flexible and still allow you to achieve what you want... What do you think? -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message