From: Matti Aarnio <matti.aarnio@zmailer.org>
To: Christoph Rohland <cr@sap.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4 and 2GB swap partition limit
Date: Mon, 5 Mar 2001 16:52:41 +0200 [thread overview]
Message-ID: <20010305165241.D15688@mea-ext.zmailer.org> (raw)
In-Reply-To: <CDF99E351003D311A8B0009027457F1403BF9E09@ausxmrr501.us.dell.com> <m3n1b0h9t3.fsf@linux.local>
In-Reply-To: <m3n1b0h9t3.fsf@linux.local>; from cr@sap.com on Mon, Mar 05, 2001 at 09:58:00AM +0100
On Mon, Mar 05, 2001 at 09:58:00AM +0100, Christoph Rohland wrote:
> Hi Matt,
>
> On Sun, 4 Mar 2001, Matt Domsch wrote:
> > My concern is that if there continues to be a 2GB swap
> > partition/file size limitation, and you can have (as currently
> > #defined) 8 swap partitions, you're limited to 16GB swap, which then
> > follows a max of 8GB RAM. We'd like to sell servers with 32GB or
> > 64GB RAM to customers who request such for their applications. Such
> > customers generally have no problem purchasing additional disks to
> > be used for swap, likely on a hardware RAID controller.
>
> I did think about that too and I also think the 2GB limit is not
> appropriate for the big servers. But I do not beleive that you need so
> much swap on these machines. If you drive a 32 GB machine so heavily
> into swap it is more busy finding the pages to swap than doing
> anything really interesting. (At least that's my experience)
While 2.4 did grow the maximum filesizes to CACHEPAGESIZE*2G
bytes by scaling pagecache contained file page offsets with
the CACHEPAGESIZE -- which may or may not be the same as the
machine PAGE_SIZE. It can be larger, though propably not smaller.
For SWAP uses there is also similar 32 bit quantity (actually
it is "unsigned long"), however some bits in the the swp_entry_t
are being used to something usefull in the cache logic besides
of the offset inside the file.
Indeed looking at the source, include/asm-i386/pgtable.h
defines following:
#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) })
The i386 actually support up to 4*16 = 64 swap files (or partitions)
with this SWP_TYPE() definition, while include/linux/swap.h does
define MAX_SWAPFILES to be 8 ... If that were a pointer array
to kmalloc()ed blocks, the limit could be much higher. Indeed
I think this is the only *static* limit anywhere in the current
swap code.
Similarly it supports 2^24 PAGES of swap at i386 per file/partition.
( 16 million pages of 4k each = 64 GB -- should be enough ;) )
( That would require vmalloc() to allocate 32 MB block, though.
That might not be possible at every occasion -> swapon may fail. )
The more I read the documentation (= source and its comments),
the more I am inclined to think that the beast *will* work with
swap-partitions (and files!) larger than 2G.
Stephen Tweedie did this 'SWAPSPACE2' work for 2.4 series, what
he might tell ? Is it really just a matter of fixing the
mkswap
utility ? Was Stephen just conservative saying:
"Don't go over 2G" (I haven't tested it)
Reviewing thru the architectural definitions of these SWP_***()
macroes, the shifts used for SWP_OFFSET seem to vary in between
7-12 and for Alpha and MIPS64: 40. Indeed things are not very
easy to understand with 64 bit architectures. It looks like
those architectures use the low 32 bits of swp_entry_t for
something, while most use at most couple of bits.
Oh, even those 64-bit system seem to give at least 24 bits for
PAGE_SIZE 'offset'. The lowest bitcount for 'offset' seems to
be at s390 which gives "only" 2^20 * 4k pages, or 4 GB per
swap file/partition. (SWP_OFFSET() shifts with 12, which is
same as PAGE_SHIFT for the machine. Why SPARC64 uses PAGE_SHIFT
in its own unique way, that I don't know.)
Somehow I suspect that the makers of each architecture port have
not quite understood what the swp_entry_t bits are used for, and
have blindly presumed them to be related to PAGE_SIZE ...
> For 2.5 we could perhaps think about a new swapfile layout which
> allows bigger partitions.
The format seems to be just fine.
> Greetings
> Christoph
/Matti Aarnio
next prev parent reply other threads:[~2001-03-05 14:53 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-04 22:04 Matt_Domsch
2001-03-05 8:58 ` Christoph Rohland
2001-03-05 14:30 ` Rik van Riel
2001-03-05 14:36 ` Rik van Riel
2001-03-05 14:52 ` Matti Aarnio [this message]
2001-03-05 13:30 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2001-05-03 14:04 Ishikawa
2001-04-30 18:45 Torrey Hoffman
2001-04-30 19:04 ` Richard B. Johnson
2001-04-30 19:07 ` David S. Miller
2001-04-30 19:14 ` Richard B. Johnson
2001-04-30 21:04 ` Andreas Ferber
2001-05-02 14:31 ` Andi Kleen
2001-05-02 22:17 ` Andreas Dilger
2001-05-04 8:16 ` Andi Kleen
2001-03-05 16:53 Andries.Brouwer
2001-03-02 21:23 Matt_Domsch
2001-03-02 23:52 ` Kenneth Johansson
2001-03-03 6:14 ` William T Wilson
2001-03-03 11:14 ` Rogier Wolff
2001-03-08 13:05 ` Goswin Brederlow
2001-04-27 10:51 ` Xavier Bestel
2001-04-27 11:13 ` Rogier Wolff
2001-04-27 20:52 ` LA Walsh
2001-04-27 21:44 ` Rik van Riel
2001-04-27 22:06 ` Thomas Dodd
2001-04-27 22:40 ` Hugh Dickins
2001-04-27 22:40 ` Rik van Riel
2001-04-29 15:12 ` Ingo Oeser
2001-04-27 22:44 ` LA Walsh
2001-04-28 7:47 ` Rogier Wolff
2001-04-27 22:22 ` Wakko Warner
2001-04-28 13:17 ` Rogier Wolff
2001-04-28 13:37 ` Wakko Warner
2001-04-28 14:11 ` Rogier Wolff
2001-04-28 14:28 ` J . A . Magallon
2001-04-30 18:12 ` Alan Cox
2001-05-01 13:00 ` Stephen C. Tweedie
2001-05-01 16:14 ` Rogier Wolff
2001-05-01 16:35 ` Stephen C. Tweedie
2001-05-02 10:54 ` Rogier Wolff
2001-05-02 11:04 ` Stephen C. Tweedie
2001-05-02 12:49 ` Hugh Dickins
2001-05-02 13:43 ` Stephen C. Tweedie
2001-05-02 0:28 ` Rik van Riel
2001-05-02 0:34 ` David S. Miller
2001-05-02 0:43 ` Rik van Riel
2001-05-02 1:14 ` Roger Larsson
2001-05-02 1:30 ` Rik van Riel
2001-05-01 13:39 ` Christoph Rohland
2001-05-01 23:25 ` Rik van Riel
2001-04-28 18:04 ` Albert D. Cahalan
2001-04-28 21:23 ` Rogier Wolff
2001-04-29 1:43 ` Jonathan Lundell
2001-04-29 9:17 ` Kenneth Johansson
2001-04-28 18:21 ` David Lang
2001-04-28 21:25 ` Rogier Wolff
2001-04-30 18:14 ` Alan Cox
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=20010305165241.D15688@mea-ext.zmailer.org \
--to=matti.aarnio@zmailer.org \
--cc=cr@sap.com \
--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
all inboxes | Powered by JetHome®