Re: Is swap == 2 * RAM a permanent thing?

Mike Harrold (mharrold@cas.org)
Thu, 15 Mar 2001 09:24:28 -0500 (EST)


> The reason is that the Linux 2.4 kernel no longer reclaims swap
> space on swapin (2.2 reclaimed swap space on write access, which
> lead to fragmented swap space in lots of workloads).
>
> This means that a lot of memory ends up "duplicated" in RAM and
> in swap.
>
> I plan on doing some code to reclaim swap space when we run out,
> but Linus doesn't seem to like that idea very much. His argument
> (when you're OOM, you should just fail instead of limp along)
> makes a lot of sense, however, and the reclaiming of swap space
> isn't really high on my TODO list ...
>
> OTOH, for people who have swap < RAM and use it just as a small
> overflow area, Linus' argument falls short, so I guess some time
> in the future we will have code to reclaim swap space when needed.

I have some questions on this.

1) If a process uses swap space and then later (after being paged
into memory -- or even not) it completes, is killed, etc., is
the swap space reclaimed then?

2) If a process uses swap, is paged into memory, and is then swapped
out again, does it re-use the same swap as before?

If the answer to either question is no, then IMHO, that's a pretty
serious design flaw.

Regards,

/Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/