linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4 and 2GB swap partition limit
@ 2001-03-02 21:23 Matt_Domsch
  2001-03-02 23:52 ` Kenneth Johansson
  2001-03-03  6:14 ` William T Wilson
  0 siblings, 2 replies; 58+ messages in thread
From: Matt_Domsch @ 2001-03-02 21:23 UTC (permalink / raw)
  To: linux-kernel

Linus has spoken, and 2.4.x now requires swap = 2x RAM.
But, the 2GB per swap partition limit still exists, best as we can tell.
So, we sell machines with say 8GB RAM.  We need 16GB swap, but really we
need like an 18GB disk with 8 2GB swap partitions, or ideally 8 disks with a
2GB swap partition on each.  That's ugly.

Is the 2GB per swap partition going to go away any time soon?

Thanks,
Matt


--
Matt Domsch
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux


^ permalink raw reply	[flat|nested] 58+ messages in thread
* RE: 2.4 and 2GB swap partition limit
@ 2001-03-04 22:04 Matt_Domsch
  2001-03-05  8:58 ` Christoph Rohland
  2001-03-05 13:30 ` Christoph Hellwig
  0 siblings, 2 replies; 58+ messages in thread
From: Matt_Domsch @ 2001-03-04 22:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: R.E.Wolff, fluffy

> > > Linus has spoken, and 2.4.x now requires swap = 2x RAM.
> > 
> > I think I missed this.  What possible value does this have? 

A good write-up of the discussion can be found at:
http://kt.zork.net/kernel-traffic/kt20010126_104.html#2


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.

We've also seen (anecdotal evidence here) cases where a kernel panics, which
we believe may have to do with having 0 < swap < 2x RAM.  We're
investigating further.

> Actually the deal is: either use enough swap (about 2x RAM) or use
> none at all. 

If swap space isn't required in all cases, great!  We'll encourage the use
of swap files as needed, rather than swap partitions.  But, if instead you
*require* swap = 2x RAM, then the 2GB swap size limitation must go.

Thanks,
Matt
	

-- 
Matt Domsch
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux

^ permalink raw reply	[flat|nested] 58+ messages in thread
* Re: 2.4 and 2GB swap partition limit
@ 2001-03-05 16:53 Andries.Brouwer
  0 siblings, 0 replies; 58+ messages in thread
From: Andries.Brouwer @ 2001-03-05 16:53 UTC (permalink / raw)
  To: cr, matti.aarnio; +Cc: linux-kernel

>> For 2.5 we could perhaps think about a new swapfile layout

> The format seems to be just fine.

No, the present definition is terrible.

Read the mkswap source. A forest of #ifdefs,
and still sometimes user assistance is required
because mkswap cannot always figure out what the "pagesize" is.

There are two main problems:
(i) "new" swap is hardly larger than "old" swap
(ii) the unit in which new swap is measured is a mystery

So, the next swap space has (i) a signature "SWAPSPACE3",
(ii) (not strictly necessary) a size given as a 64-bit number in bytes.
Moreover, the swapon call must not refuse swapspaces
that are larger than the kernel can handle.

Andries

^ permalink raw reply	[flat|nested] 58+ messages in thread
* RE: 2.4 and 2GB swap partition limit
@ 2001-04-30 18:45 Torrey Hoffman
  2001-04-30 19:04 ` Richard B. Johnson
  2001-04-30 19:07 ` David S. Miller
  0 siblings, 2 replies; 58+ messages in thread
From: Torrey Hoffman @ 2001-04-30 18:45 UTC (permalink / raw)
  To: 'Kenneth Johansson', Jonathan Lundell; +Cc: linux-kernel



Kenneth Johansson wrote:
> Jonathan Lundell wrote:
> >
> > (Does Linux swap out text, by the way, he asks ignorantly?)
> 
> .text is just droped and read back from the actuall file it's 
> not put into the swap

Is this always true, even for init?  Can init be swapped out?  

In general, is there a safe way to replace executable files for
programs that might be running while their on-disk images are
replaced?

Thanks for any hints...

Torrey Hoffman
torrey.hoffman@myrio.com

^ permalink raw reply	[flat|nested] 58+ messages in thread
* Re: 2.4 and 2GB swap partition limit
@ 2001-05-03 14:04 Ishikawa
  0 siblings, 0 replies; 58+ messages in thread
From: Ishikawa @ 2001-05-03 14:04 UTC (permalink / raw)
  To: linux-kernel

J. A. Magallon wrote:
>I'm not so sure it's only a 'rule of thumb'. Do not know the state of
>paging in just released 2.4.4, but in previuos kernel, a page that was
>paged-out, reserves its place in swap even if it is paged-in again, so
>once you have paged-out all your ram at least once, you can't get any
>more memory, even if swap is 'empty'.

I am not sure if I see the behavior of the kernel mentioned above, but
it seems that once the swap partition is used,
it may not be released forever : kernel 2.4.x.

Background:
I experienced a very strange X server crash (when a certain page
is access via netscape, and a string is searched successively,
on the second or the third search, the X server crash.)
I downloaded the Xfree 86 source file to re-create the problem and
see where the segmentation error of X server occurs by having a server
with debug symbols in it, and finally
traced it to an incorrect pointer value used in the backing store bitblt
routine.
However, I can't see the pointer value is an incorrect one at all.
(Maybe I am not familar enough with mmap and unmap calls invoked
by malloc() and free().)
Also, I was a little surprised to see a bug of this nature to remain
in X server at this stage.

Anyway, suspecting some sort of VM problem on the kernel side,
I wrote the attached program and run it to see
the behavior of the system when swap partition was first used.
(The situation where X server crashes is when the system is
just about to use Swap in my current config: 256 MB memory
and 80MB swap).

After running the few invocation of the attached program with
varying arguments, I noticed that once the swap is used (I view it
usinx xosview from X or cat /proc/meminfo ).
the used swap does not seem to get released!?

I thought it was suspicious, but didn't speak up since if this were
a bug, this would  indeed be a showstopper for many commercial
application.
Someone must have realized this and fixed it already, so I thought.

>From the current discussion, I notice that this may be indeed
an unwanted behavior.
If this is a bug of 2.4.x VM, then I think some installations
would appreciate it very much.


--- memhog.c

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/*
 * using realloc() will call mremap().
 * using malloc() and free calls mmap, and munmap().
 */
static usage()
{
  fprintf(stderr,"memhog [limit]\nlimit is in MB units Default is 64
(MB).\n");
  exit(EXIT_FAILURE);
}

int main(argc, argv)
     int argc;
     char *argv[];
{

  int i;
  char *p = NULL;

#define MB (1024 * 1024 )
  int limit = 64 * MB;

  if (argc == 2)
    {
      int t;
      t = atoi(argv[1]);
      if(t <= 0)
        {
          usage();
        }

      limit = t * MB;

    }
  else if (argc >= 3)
    {
      usage();
    }


  i = MB;

  while (i <= limit )
    {
      printf("i = %d\n", i);

#ifdef USE_REALLOC
      p = realloc(p, i);
#else
      p = malloc(i);
#endif

      if( p == NULL)
        {
          printf("malloc returned NULL\n");
          exit(EXIT_FAILURE);
        }

      memset(p, 0xA5, i);

      sleep (1);

#ifdef USE_REALLOC
      /* free(p); */
#else
      free(p);
#endif

      /*     i *= 2; */
      i += 1 * MB;
    }


  exit (EXIT_SUCCESS);

}





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

end of thread, other threads:[~2001-05-04  8:17 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-02 21:23 2.4 and 2GB swap partition limit 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
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
2001-03-05 13:30 ` Christoph Hellwig
2001-03-05 16:53 Andries.Brouwer
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-05-03 14:04 Ishikawa

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).