Re: why swap at all?

From: William Lee Irwin III
Date: Thu May 27 2004 - 11:17:36 EST


Quote from William Lee Irwin III <wli@xxxxxxxxxxxxxx>:
>> Yes. You want swap so you can physically relocate anonymous pages in the
>> rare case one ends up somewhere it could cause memory pressure against
>> allocations that can only be satisfied by a restricted range of memory.

On Thu, May 27, 2004 at 04:59:52PM +0100, John Bradford wrote:
> I think you are assuming a 100% perfect VM system. In practice, if
> the machine isn't heavily loaded, unnecessary swap is more likely to
> cause, (slight, and possibly negligable), slowdowns, than bring any
> noticable performance benefit.

First, the above not a performance issue to begin with. It's a workload
feasibility issue. Second, the only overhead of swap when it's unused
is vmallocspace. Third, the only way to eliminate the runtime overhead
of the swap layer is CONFIG_SWAP=n.

The above scenario is not particularly common, but can be "fatal" to
the critical applications whose allocations were infeasible. I'd
recommend using a small amount of swapspace on your 16GB machine, e.g.
256MB or 512MB. One method of removing this requirement that swapspace
be configured so the kernel can get itself out of this pathological
situation is to implement page migration, so that memory movement e.g.
between zones need not be carried out through a backing store.

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