linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: Andries.Brouwer@cwi.nl, levon@movementarian.org
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org
Subject: Re: Maximum x86 swap partition size ?
Date: Mon, 18 Aug 2003 20:39:28 +0200 (MEST)	[thread overview]
Message-ID: <UTC200308181839.h7IIdSG10173.aeb@smtp.cwi.nl> (raw)

> Any reason you haven't responded ?

It is still in my inbox.
# received letters/day >> # answered letters/day

A careful answer requires inspection of the development of
the code involved. Let me give a rough answer from memory,
clarifying why mkswap contains severe restrictions.

Long ago:
Swap space started with a bit map of bad blocks. This is v0.
Later:
Swap space starts with a header that lists the bad blocks. This is v1.

V1 swap space was a disaster for several reasons.

The first problem is that nobody knows where the signature is,
because that is at the end of the page, and a "page" may be a
natural object for a kernel developer, it is not in user space.
Right now a large part of the source of mkswap consists of finding out
how large a page is, and in bad cases we can't, and need a user option.

The second problem is that old kernels will refuse the swapon
system call when the swapspace is too large (instead of only
using the part the kernel likes). That again means lots of
garbage code, trying to figure out what size swapspace the kernel
will accept.

The strange limitations documented in mkswap(8) are true limitations
for certain oldish kernels. If the assumption is that nobody uses
2.2 anymore then these can be removed. But lots of people still use 2.2.

I might send Alan a patch to remove this restriction in 2.2.

Alan: the bad fragment lives in swapfile.c and is

               if (p->max >= SWP_OFFSET(SWP_ENTRY(0,~0UL)))
                        goto bad_swap;

If it is still there (I have somewhat poor net and source access
right now) it could be changed to something like

               swaplimit = SWP_OFFSET(SWP_ENTRY(0,~0UL));
	       if (p->max >= swaplimit)
	                p->max = swaplimit-1;

	

Andries

Let me cc l-k.


             reply	other threads:[~2003-08-18 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-18 18:39 Andries.Brouwer [this message]
2003-08-18 18:57 ` Maximum x86 swap partition size ? John Levon

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=UTC200308181839.h7IIdSG10173.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).