Re: Swap size for a machine with 2GB of memory

From: Andries.Brouwer@cwi.nl
Date: Sun Aug 19 2001 - 19:08:40 EST


    From: ebiederm@xmission.com (Eric W. Biederman)
    Date: 19 Aug 2001 14:49:23 -0600

    "Eric S. Raymond" <esr@thyrsus.com> writes:

> The Red Hat installation manual claims that the size of the
> swap partition should be twice the size of physical memory,
> but no more than 128MB.
>
> Should I believe the above formula?

You give two statements. The 128 MB bound was claimed by Microsoft
and we screamed loudly that that was a lie - now it is claimed
by both SuSE and RedHat. Funny.
No, the bound is not 128 MB. See mkswap(8).

    With respect to swap partitions the current limit is about 64Gig.
    You can actually make a larger swap partition but the kernel on x86
    only uses 24 offset bits into that partition. The 128MB partition
    existed but was removed long ago.

Long ago I wrote in mkswap(8) that the max on i386 is about 2 GiB.
I seem to recall that at some point in time the swap size in
bytes had to fit in a signed long, and indeed, 2.1.117 has
        if (p->max >= 0x7fffffffL/PAGE_SIZE ...
2.2.0pre9 changed this into
        if (p->max >= SWP_OFFSET(SWP_ENTRY(0,~0UL)))
deleting this restriction.
If it is no longer there, I suppose I should change mkswap.c.
Stephen, can you confirm?

Andries
-
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/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:32 EST