linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Requirement: swap = RAM x 2.5 ??
       [not found]         ` <000701c0ee9f$515fd6a0$3303a8c0@einstein>
@ 2001-06-06 15:57           ` Jeff Garzik
  2001-06-06 16:12             ` Richard Gooch
  2001-06-06 18:42             ` Eric W. Biederman
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Garzik @ 2001-06-06 15:57 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: Christian Bornträger, Derek Glidden

I'm sorry but this is a regression, plain and simple.

Previous versons of Linux have worked great on diskless workstations
with NO swap.

Swap is "extra space to be used if we have it" and nothing else.

-- 
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |
--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 15:57           ` Requirement: swap = RAM x 2.5 ?? Jeff Garzik
@ 2001-06-06 16:12             ` Richard Gooch
  2001-06-06 16:15               ` Jeff Garzik
  2001-06-06 18:42             ` Eric W. Biederman
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Gooch @ 2001-06-06 16:12 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-kernel, linux-mm, Christian Bornträger, Derek Glidden

Jeff Garzik writes:
> 
> I'm sorry but this is a regression, plain and simple.
> 
> Previous versons of Linux have worked great on diskless workstations
> with NO swap.
> 
> Swap is "extra space to be used if we have it" and nothing else.

Sure. But Linux still works without swap. It's just that if you *do*
have swap, it works best with 2* RAM.

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca
--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 16:12             ` Richard Gooch
@ 2001-06-06 16:15               ` Jeff Garzik
  2001-06-06 16:19                 ` Richard Gooch
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2001-06-06 16:15 UTC (permalink / raw)
  To: Richard Gooch
  Cc: linux-kernel, linux-mm, Christian Bornträger, Derek Glidden

Richard Gooch wrote:
> 
> Jeff Garzik writes:
> >
> > I'm sorry but this is a regression, plain and simple.
> >
> > Previous versons of Linux have worked great on diskless workstations
> > with NO swap.
> >
> > Swap is "extra space to be used if we have it" and nothing else.
> 
> Sure. But Linux still works without swap. It's just that if you *do*
> have swap, it works best with 2* RAM.

Yes, but that's not the point of the discussion.  Currently 2*RAM is
more of a requirement than a recommendation.

-- 
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |
--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 16:15               ` Jeff Garzik
@ 2001-06-06 16:19                 ` Richard Gooch
  2001-06-06 16:53                   ` Mike Galbraith
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Gooch @ 2001-06-06 16:19 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-kernel, linux-mm, Christian Bornträger, Derek Glidden

Jeff Garzik writes:
> Richard Gooch wrote:
> > 
> > Jeff Garzik writes:
> > >
> > > I'm sorry but this is a regression, plain and simple.
> > >
> > > Previous versons of Linux have worked great on diskless workstations
> > > with NO swap.
> > >
> > > Swap is "extra space to be used if we have it" and nothing else.
> > 
> > Sure. But Linux still works without swap. It's just that if you *do*
> > have swap, it works best with 2* RAM.
> 
> Yes, but that's not the point of the discussion.  Currently 2*RAM is
> more of a requirement than a recommendation.

Um, do you mean "2*RAM is required, always", or "2*RAM or more swap is
required if swap != 0"?

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca
--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 16:19                 ` Richard Gooch
@ 2001-06-06 16:53                   ` Mike Galbraith
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Galbraith @ 2001-06-06 16:53 UTC (permalink / raw)
  To: Richard Gooch
  Cc: Jeff Garzik, linux-kernel, linux-mm, Christian Bornträger,
	Derek Glidden

On Wed, 6 Jun 2001, Richard Gooch wrote:

> Jeff Garzik writes:
> > Richard Gooch wrote:
> > >
> > > Jeff Garzik writes:
> > > >
> > > > I'm sorry but this is a regression, plain and simple.
> > > >
> > > > Previous versons of Linux have worked great on diskless workstations
> > > > with NO swap.
> > > >
> > > > Swap is "extra space to be used if we have it" and nothing else.
> > >
> > > Sure. But Linux still works without swap. It's just that if you *do*
> > > have swap, it works best with 2* RAM.
> >
> > Yes, but that's not the point of the discussion.  Currently 2*RAM is
> > more of a requirement than a recommendation.
>
> Um, do you mean "2*RAM is required, always", or "2*RAM or more swap is
> required if swap != 0"?

When Rik starts to reclaim unused swap (didn't he say he was going to
do that?) this will instantly revert to the most respected of rules..
rules are made to be b0rken.

	-Mike

--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 15:57           ` Requirement: swap = RAM x 2.5 ?? Jeff Garzik
  2001-06-06 16:12             ` Richard Gooch
@ 2001-06-06 18:42             ` Eric W. Biederman
  2001-06-07  1:29               ` Jan Harkes
  1 sibling, 1 reply; 7+ messages in thread
From: Eric W. Biederman @ 2001-06-06 18:42 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, linux-mm, Christian Borntrdger, Derek Glidden

Jeff Garzik <jgarzik@mandrakesoft.com> writes:

> I'm sorry but this is a regression, plain and simple.
> 
> Previous versons of Linux have worked great on diskless workstations
> with NO swap.
> 
> Swap is "extra space to be used if we have it" and nothing else.

Given the slow speed of disks to use them efficiently when you are using
swap some additional rules apply.

In the worse case when swapping is being used you get:
Virtual Memory = RAM + (swap - RAM).

That cannot be improved.  You can increase your likely hood that that case won't
come up, but that is a different matter entirely.  

I suspect in practice that we are suffering more from lazy reclamation
of swap pages than from a more aggressive swap cache. 

Eric

--
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/

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

* Re: Requirement: swap = RAM x 2.5 ??
  2001-06-06 18:42             ` Eric W. Biederman
@ 2001-06-07  1:29               ` Jan Harkes
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Harkes @ 2001-06-07  1:29 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Jeff Garzik, linux-kernel, linux-mm, Christian Borntrdger, Derek Glidden

On Wed, Jun 06, 2001 at 12:42:03PM -0600, Eric W. Biederman wrote:
> Jeff Garzik <jgarzik@mandrakesoft.com> writes:
> > I'm sorry but this is a regression, plain and simple.
> > 
> > Previous versons of Linux have worked great on diskless workstations
> > with NO swap.
> > 
> > Swap is "extra space to be used if we have it" and nothing else.
> 
> Given the slow speed of disks to use them efficiently when you are using
> swap some additional rules apply.
> 
> In the worse case when swapping is being used you get:
> Virtual Memory = RAM + (swap - RAM).
> 
> That cannot be improved.  You can increase your likely hood that that
> case won't come up, but that is a different matter entirely.  

I believe you are taking the right approach to the problem, which is not
to complain about that we need 2*RAM, but to try and figure out _why_ we
need 2*RAM.

As far as I can make out, any pages that at one time got swapped out,
will remain in swap. It is even there when there are no more references
to the page, but will be reclaimed lazily (i.e. when we need to swap
something new out).

I'm assuming the reason we need SWAP > RAM is because once swap is filled
only the subset of VM users that occupy this space are candidates for
further swapping. I'm assuming this probably has a significant impact on
long-running processes that have more chance of being pushed into swap
at some point.

The advantage of this is that when we need to remove a clean page that
is already in swap we can simply discard the copy in ram, paying only a
swap-in penalty. Dirty pages will have to be re-written, but we don't
need to find a place to put them, swap is already reserved. If we wanted
reclaim swap pages that were swapped into ram, we need to find a place
to swap to, swap the page out, and eventually swap it back in. Obviously
a lot more expensive.

However, we must have pushed the page into swap because it was not
'pageable'. i.e. it got dirtied, and there is no underlying file to
write it back to, shm, private mmap, or dirty heap. So there is infact a
high likelyhood that the page will not be clean when we have to swap it
out again.

Now if we would reclaim not just dead swap pages, but also pages that
have been swapped in but are dirtied, the 'additional cost' only
involves finding a place to swap to. The nice thing is that with fewer
used swap pages as a result of agressive reclaiming of swapped but in
the mean time swapped back in and dirtied pages it should become a lot
easier to find a free spot (until we are really overcommitted).

I don't know how feasable it is to tell from a given swap page, whether
there is a dirtied copy present in ram, but we could drop the swap
reference when the copy in ram is modified, turning the swap page into a
dead page and letting the regular reclamation pick it up.

Jan

--
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/

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

end of thread, other threads:[~2001-06-07  1:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3B1D5ADE.7FA50CD0@illusionary.com>
     [not found] ` <991815578.30689.1.camel@nomade>
     [not found]   ` <20010606095431.C15199@dev.sportingbet.com>
     [not found]     ` <0106061316300A.00553@starship>
     [not found]       ` <200106061528.f56FSKa14465@vindaloo.ras.ucalgary.ca>
     [not found]         ` <000701c0ee9f$515fd6a0$3303a8c0@einstein>
2001-06-06 15:57           ` Requirement: swap = RAM x 2.5 ?? Jeff Garzik
2001-06-06 16:12             ` Richard Gooch
2001-06-06 16:15               ` Jeff Garzik
2001-06-06 16:19                 ` Richard Gooch
2001-06-06 16:53                   ` Mike Galbraith
2001-06-06 18:42             ` Eric W. Biederman
2001-06-07  1:29               ` Jan Harkes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox