All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* Maximum size of a swap partition
@ 2009-05-28  7:31 Christoph Pleger
  2009-05-29  6:30 ` Christoph Pleger
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Pleger @ 2009-05-28  7:31 UTC (permalink / raw
  To: linux-kernel

Hello,

what is the maximum size of a swap partition with Kernel 2.6.26 on an
x86 and on an x86_64 machine? Some people say that it is 2GB on x86,
but that seems not to be true any more.

Regards
  Christoph 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Maximum size of a swap partition
  2009-05-28  7:31 Maximum size of a swap partition Christoph Pleger
@ 2009-05-29  6:30 ` Christoph Pleger
  2009-05-29  6:47   ` KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Pleger @ 2009-05-29  6:30 UTC (permalink / raw
  To: linux-kernel

Hello,

> what is the maximum size of a swap partition with Kernel 2.6.26 on an
> x86 and on an x86_64 machine? Some people say that it is 2GB on x86,
> but that seems not to be true any more.

Is here, in the mailing list where the power of kernel knowledge
resides, really no one able to answer that question within one day?

Regards
  Christoph

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Maximum size of a swap partition
  2009-05-29  6:30 ` Christoph Pleger
@ 2009-05-29  6:47   ` KAMEZAWA Hiroyuki
  2009-05-29  7:06     ` KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-05-29  6:47 UTC (permalink / raw
  To: Christoph Pleger; +Cc: linux-kernel

On Fri, 29 May 2009 08:30:54 +0200
Christoph Pleger <Christoph.Pleger@cs.tu-dortmund.de> wrote:

> Hello,
> 
> > what is the maximum size of a swap partition with Kernel 2.6.26 on an
> > x86 and on an x86_64 machine? Some people say that it is 2GB on x86,
> > but that seems not to be true any more.
> 
> Is here, in the mailing list where the power of kernel knowledge
> resides, really no one able to answer that question within one day?
> 
Mailing list is not a place where a kind man reads all e-mails every day.

At first, start from man. man mkswap says.
==
      The maximum useful size of a swap area depends on the architecture  and
       the  kernel  version.  It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB
       on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64. For ker-
       nels after 2.3.3 there is no such limitation.
==
 For kernels after 2.3.3 there is no such limitation.

>From code,
==
union swap_header {
        struct {
                char reserved[PAGE_SIZE - 10];
                char magic[10];                 /* SWAP-SPACE or SWAPSPACE2 */
        } magic;
        struct {
                char            bootbits[1024]; /* Space for disklabel etc. */
                __u32           version;
                __u32           last_page;
                __u32           nr_badpages;
                unsigned char   sws_uuid[16];
                unsigned char   sws_volume[16];
                __u32           padding[117];
                __u32           badpages[1];
        } info;
};
==

last_page represents the size of a swap partition.

Then, 
  UINT_MAX * PAZE_SIZE = 16Tbytes ? is a limitation for a swap device.
  you can use 30 swap devices now.

I'm not sure whether there are other limitations. But maybe enough big.

Bye,
-Kame



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Maximum size of a swap partition
  2009-05-29  6:47   ` KAMEZAWA Hiroyuki
@ 2009-05-29  7:06     ` KAMEZAWA Hiroyuki
  2009-05-29  8:04       ` Christoph Pleger
  0 siblings, 1 reply; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-05-29  7:06 UTC (permalink / raw
  To: KAMEZAWA Hiroyuki; +Cc: Christoph Pleger, linux-kernel

On Fri, 29 May 2009 15:47:01 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:


> I'm not sure whether there are other limitations. But maybe enough big.
> 
I missed the another story.

For managing swap, the kernel uses 2bytes per 1 swap entry.
Then, if swap parttion is 1Gbytes, the kernel uses 512k bytes of memory.

in x86, this memory is allocated from vmalloc() area (you can see it in meminfo)
and it has only 80?MB. And there are other users of this area.

Then, in real x86-32bit world, you can't use verrrrry big swap device.

Then, 16GB=8MB in the kernel (or some more) is realistic limitation for usual
users.

Thanks,
-Kame


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Maximum size of a swap partition
  2009-05-29  7:06     ` KAMEZAWA Hiroyuki
@ 2009-05-29  8:04       ` Christoph Pleger
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Pleger @ 2009-05-29  8:04 UTC (permalink / raw
  To: KAMEZAWA Hiroyuki; +Cc: linux-kernel

Hello,

On Fri, 29 May 2009 16:06:07 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> I missed the another story.

Many thanks for your answers, that not only gave me the values I
wanted, but also let me understand how that values are calculated.

Regards
  Christoph

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-29  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28  7:31 Maximum size of a swap partition Christoph Pleger
2009-05-29  6:30 ` Christoph Pleger
2009-05-29  6:47   ` KAMEZAWA Hiroyuki
2009-05-29  7:06     ` KAMEZAWA Hiroyuki
2009-05-29  8:04       ` Christoph Pleger

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.