Re: Memory Management - BSD vs Linux

Jacques Gelinas (jack@solucorp.qc.ca)
Tue, 12 Aug 1997 15:01:05 -0400 (EDT)


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