All of lore.kernel.org
 help / color / mirror / Atom feed
* swap: which is the maximum size allowed?
@ 2007-01-28 20:09 Eriberto
  0 siblings, 0 replies; 6+ messages in thread
From: Eriberto @ 2007-01-28 20:09 UTC (permalink / raw)
  To: linux-kernel

Hello,

I am trying understand the swap. I would like to know which is the
maximum swap size on i386. Is 64 MB? If yes, how to know the origin of
this "magic" number? I don't found it (Internet).

Thanks in advance.

Eriberto - Brazil


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

* Re: swap: which is the maximum size allowed?
       [not found] <7IoP9-5nQ-27@gated-at.bofh.it>
@ 2007-01-28 22:43 ` Bodo Eggert
  2007-01-28 23:01   ` Eriberto
  0 siblings, 1 reply; 6+ messages in thread
From: Bodo Eggert @ 2007-01-28 22:43 UTC (permalink / raw)
  To: Eriberto, linux-kernel

Eriberto <eriberto@eriberto.pro.br> wrote:

> I am trying understand the swap. I would like to know which is the
> maximum swap size on i386. Is 64 MB? If yes, how to know the origin of
> this "magic" number? I don't found it (Internet).

Look into the manpage of mkswap. It's 2 G x 32 swap partitions,
minus a tiny overhead.
-- 
"Whoever said the pen is mightier than the sword obviously never
encountered automatic weapons."
-Gen. Douglas MacArthur
Friß, Spammer: p1xdJqpr@wIueuDz.7eggert.dyndns.org

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

* Re: swap: which is the maximum size allowed?
  2007-01-28 22:43 ` Bodo Eggert
@ 2007-01-28 23:01   ` Eriberto
  2007-01-29  0:19     ` Matt Mackall
  0 siblings, 1 reply; 6+ messages in thread
From: Eriberto @ 2007-01-28 23:01 UTC (permalink / raw)
  To: linux-kernel

Ok. But, mkswap man is old (1999). However, from Linux Partition HOWTO:

"footnote: "official" max swap size: With kernel 2.4, the limit is 64
swap spaces at a maximum of 64Gb each, although this is not reflected in
the man page for mkswap. With the 64 bit opteron on the 2.6 kernel, 128
swap areas are permitted, each a whopping 16 Tb! (thanks to Peter Chubb
for the calculation)"

I want to know: why 64 GB???

Thanks,

Eriberto - www.eriberto.pro.br

Bodo Eggert escreveu:
> Look into the manpage of mkswap. It's 2 G x 32 swap partitions,
> minus a tiny overhead.


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

* Re: swap: which is the maximum size allowed?
  2007-01-28 23:01   ` Eriberto
@ 2007-01-29  0:19     ` Matt Mackall
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Mackall @ 2007-01-29  0:19 UTC (permalink / raw)
  To: Eriberto; +Cc: linux-kernel

On Sun, Jan 28, 2007 at 09:01:34PM -0200, Eriberto wrote:
> Ok. But, mkswap man is old (1999). However, from Linux Partition HOWTO:
> 
> "footnote: "official" max swap size: With kernel 2.4, the limit is 64
> swap spaces at a maximum of 64Gb each, although this is not reflected in
> the man page for mkswap. With the 64 bit opteron on the 2.6 kernel, 128
> swap areas are permitted, each a whopping 16 Tb! (thanks to Peter Chubb
> for the calculation)"
> 
> I want to know: why 64 GB???

It's how big the available pointers are.

-- 
Mathematics is the supreme nostalgia of our time.

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

* swap: which is the maximum size allowed?
@ 2007-01-29 19:46 Eriberto
  2007-01-29 20:02 ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Eriberto @ 2007-01-29 19:46 UTC (permalink / raw)
  To: linux-mm

Hello,

I am trying understand the swap. I would like to know which is the
maximum swap size on i386. Is 64 GB? If yes, how to know the origin of
this "magic" number? How to calculate it? I don't found it (Internet).

Thanks in advance.

Eriberto - Brazil


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: swap: which is the maximum size allowed?
  2007-01-29 19:46 Eriberto
@ 2007-01-29 20:02 ` Christoph Lameter
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2007-01-29 20:02 UTC (permalink / raw)
  To: Eriberto; +Cc: linux-mm

On Mon, 29 Jan 2007, Eriberto wrote:

> I am trying understand the swap. I would like to know which is the
> maximum swap size on i386. Is 64 GB? If yes, how to know the origin of
> this "magic" number? How to calculate it? I don't found it (Internet).

If you look at include/asm-i386/pgtable-2level.h


/*
 * Bits 0, 6 and 7 are taken, split up the 29 bits of offset
 * into this range:
 */
#define PTE_FILE_MAX_BITS       29

#define pte_to_pgoff(pte) \
        ((((pte).pte_low >> 1) & 0x1f ) + (((pte).pte_low >> 8) << 5 ))

#define pgoff_to_pte(off) \
        ((pte_t) { (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + 
_PAGE_FILE })

/* Encode and de-code a swap entry */
#define __swp_type(x)                   (((x).val >> 1) & 0x1f)
#define __swp_offset(x)                 ((x).val >> 8)
#define __swp_entry(type, offset)       ((swp_entry_t) { ((type) << 1) | 
((offset) << 8) })
#define __pte_to_swp_entry(pte)         ((swp_entry_t) { (pte).pte_low })
#define __swp_entry_to_pte(x)           ((pte_t) { (x).val })

5 bits are used for the swap file number (__swp_type). This gives you 32 
swap fileswith 2^(29-5)*PAGE_SIZE = 64 GB each.

The swap size is bigger if you use 3 page table levels.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2007-01-29 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-28 20:09 swap: which is the maximum size allowed? Eriberto
     [not found] <7IoP9-5nQ-27@gated-at.bofh.it>
2007-01-28 22:43 ` Bodo Eggert
2007-01-28 23:01   ` Eriberto
2007-01-29  0:19     ` Matt Mackall
  -- strict thread matches above, loose matches on Subject: below --
2007-01-29 19:46 Eriberto
2007-01-29 20:02 ` Christoph Lameter

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.