Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2001 17:56:53 -0500
From:      Alfred Perlstein <bright@mu.org>
To:        Vladimir Dozen <vladimir-dozen@mail.ru>
Cc:        Matt Dillon <dillon@earth.backplane.com>, Wilko Bulte <wkb@freebie.xs4all.nl>, hackers@FreeBSD.ORG
Subject:   Re: VM: dynamic swap remapping (patch)
Message-ID:  <20010929175653.Z59854@elvis.mu.org>
In-Reply-To: <20010929232953.B341@eix.do-labs.spb.ru>; from vladimir-dozen@mail.ru on Sat, Sep 29, 2001 at 11:29:53PM %2B0000
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>

next in thread | previous in thread | raw e-mail | index | archive | help
* Vladimir Dozen <vladimir-dozen@mail.ru> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010929175653.Z59854>