From: Andreas Dilger <adilger@turbolabs.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Michael Peddemors <michael@wizard.ca>, linux-kernel@vger.kernel.org
Subject: Re: Current Max Swap size? Performance issues
Date: Mon, 19 Nov 2001 02:48:56 -0700 [thread overview]
Message-ID: <20011119024856.E1308@lynx.no> (raw)
In-Reply-To: <1005948151.10803.18.camel@mistress> <20011116163346.L1308@lynx.no> <m1itc88ue5.fsf@frodo.biederman.org>
In-Reply-To: <m1itc88ue5.fsf@frodo.biederman.org>; from ebiederm@xmission.com on Sat, Nov 17, 2001 at 11:28:50PM -0700
On Nov 17, 2001 23:28 -0700, Eric W. Biederman wrote:
> Andreas Dilger <adilger@turbolabs.com> writes:
> > > 2 GIG swap partition (Is this still the limit?)
> >
> > Yes, still the limit. It turns out that this is not an on-disk format
> > limit, but rather an in-memory structure limit, in case you cared. For
> > non-x86 platforms, there is a different limit.
>
> Where? The limit should be about 64GB or so on x86. If it isn't it should
> be just a couple of lines to change it. Or is the limit the vmalloc
> of the swap_map?
In my mm/swapfile.c code, I added comments about this, when I was adding
support for LABELs in swapfiles. The new swapfile limits say:
/* The new swap format has a page count and a list of page
* numbers which overlap bad blocks on disk. We are limited
* to 2^32 pages by the on-disk format (info.last_page and
* page numbers in badpages are both unsigned ints, 16TiB for
* 4kiB pages). We are also limited by SWP_ENTRY() which
* varies by architecture (64GiB for ia32).
*/
maxpages = SWP_OFFSET(SWP_ENTRY(0,~0UL)) - 1;
and include/asm-i386/pgtable.h has:
#define SWP_TYPE(x) (((x).val >> 1) & 0x3f)
#define SWP_OFFSET(x) ((x).val >> 8)
#define SWP_ENTRY(type, offset) ((swp_entry_t){((type) << 1) | ((offset) << 8)})
So, we are limited to 2^24 pages of swap from a single swapfile, and 4kB
pages (2^12), so 2^36 bytes of swap, which would be 64GB per swapfile.
Hmm, this means I don't know where the 2GB limit comes from. If we look
at the vmalloc of maxpages, we have 2x maxpages, so 2^25, or 32MB allocated
for a 64GB swapfile. I don't know if that would be a problem. For a
2GB swapfile, that would only be 1MB for the swap_map allocation.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
prev parent reply other threads:[~2001-11-19 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-16 22:02 Current Max Swap size? Performance issues Michael Peddemors
2001-11-16 23:33 ` Andreas Dilger
2001-11-18 6:28 ` Eric W. Biederman
2001-11-19 9:48 ` Andreas Dilger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011119024856.E1308@lynx.no \
--to=adilger@turbolabs.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@wizard.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.