Re: Memory Management - BSD vs Linux

Rob Hagopian (hagopiar@vuser.vu.union.edu)
Tue, 12 Aug 1997 17:21:45 -0400 (EDT)


I like the Solaris method; we have a machine that uses one partition as
both tmp space and swap... For people who need a few hundred megs of swap,
it's there, but if you need a few hundred megs of tmp space, it's there...
I believe that it's actually a filesystem in that there isn't a file
visible that gets grown.
For instance, we run mkstats on our web logs each week, late Sunday night.
Last week we ran out of swap (not a pretty picture Monday morning). It
would have been great if the visible tmp space went down while swap went
up; nothing else runs then (and I doubt anyone's logged in) to use that
space. During the rest of the week, we don't need that much swap and the
tmp space is much more valuable.
Granted, I could write a script to add extra swap before running the
script, but that's really a rather poor fix... (fixing mkstats so it
doesn't need so much memory OTOH...)
-Rob H.

On Tue, 12 Aug 1997, Jacques Gelinas wrote:

> On 11 Aug 1997 thospel@mail.dma.be wrote:
>
> >
> > In article <199708111305.PAA01801@cave.bitwizard.nl>,
> > R.E.Wolff@BitWizard.nl (Rogier Wolff) writes:
> > > Darren Reed wrote:
> > >>
> > >> In some mail I received from Theodore Y. Ts'o, sie wrote
> > >> >
> > >> > [3] Can any of these systems have
> > >> > a) swap files rather than partitions
> > >> > b) dynamically growing swap space?
> > >> > As far as I can make out, the answeris no!
> > >> >
> > >> > Linux can swap to files (multiple files if necessary), and there is a
> > >> > user-mode daemon that can allow you to dyanmically grow swap space (by
> > >> > allocating a new file).
> > >>
> > >> NetBSD has swapfiles and does not require a daemon to be running for more
> > >> to be added. NetBSD has also since moved on from just swap(2) to having
> > >
> > > So? That's dumb. Linux implements as much as possible in userspace.
> > > Only things that have a genuine need to be in the kernel go in the
> > > kernel.
> >
> > In principle, I agree. But I always wondered how well this really works.
> > e.g. kernel suddenly needs a lot of swap, asks for it, oops, low, and
> > the request fails before swapd got a chance to add this big file just
> > waiting to be converted to swap. Or maybe swapd itself is swapped out,
> > and to get it in again needs more swap than available. I would be VERY
> > surprised if the simple solution of swapd was not full of races.
> >
> > anybody with deep knowledge about the memory management who can lay my
> > fears to rest (or keep them awake) ?
>
> Adding swap dynamicly is a big lie. When you need the space, it is not
> available because it has been taken by files. You can always limit files
> to make sure that space will be available for swap, but then you are
> better to allocate you swap immediatly.
>
> --------------------------------------------------------
> Jacques Gelinas (jacques@solucorp.qc.ca)
> Linuxconf: The ultimate administration system for Linux.
> see http://www.solucorp.qc.ca/linuxconf
> new development: dhcp, disk quota management, virtual email accounts
>