9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Swap considered harmful (Sorry)
@ 2006-07-13 13:52 Brantley Coile
  2006-07-13 14:06 ` Charles Forsyth
  2006-07-13 16:09 ` Ronald G Minnich
  0 siblings, 2 replies; 12+ messages in thread
From: Brantley Coile @ 2006-07-13 13:52 UTC (permalink / raw)
  To: 9fans


char Ephil[] = "It's all Phil's fault";


> From: "rob pike" <;rob@plan9.bell-labs.com>;
> Subject: Re: [9fans] Virtual memory in BSD and Plan9
> Date: Mon, 29 Oct 2001 07:38:17 -0500
>
> I'm a radical here, but I think if a machine is paging, you've lost.
> To me, VM is a pretty technique for memory management in the kernel,
> something distinct from paging, which is a way to get the system
> through temprorary overshoots in memory demand.
>
> My boss when the first Plan 9 kernel was being written was Sandy
> Fraser, who had worked on Atlas, one of the first VM systems.  When he
> heard that I was putting VM into Plan 9 (a situation more accurately
> described as building Plan 9's original memory manager around a VM
> model), he literally called me on the carpet.  He said that he hated
> VM bitterly because of the Atlas days, in which nothing got done
> because the system was always thrashing.  I pointed out the
> distinction between VM and paging, explained that I was implementing
> VM but not paging (Phil W. put paging in a few years later), and
> justified my decision by pointing out that with memory so cheap today,
> there was really no reason to depend on the paging system to manage
> your working set except for the occasional brief overrun on demand.
>
> -rob



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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 13:52 [9fans] Swap considered harmful (Sorry) Brantley Coile
@ 2006-07-13 14:06 ` Charles Forsyth
  2006-07-13 16:07   ` Ronald G Minnich
  2006-07-13 16:09 ` Ronald G Minnich
  1 sibling, 1 reply; 12+ messages in thread
From: Charles Forsyth @ 2006-07-13 14:06 UTC (permalink / raw)
  To: 9fans

>> He said that he hated
>> VM bitterly because of the Atlas days, in which nothing got done
>> because the system was always thrashing.  I pointed out the

there are schemes that avoid having no work get done (for anyone).
unfortunately, most paging systems didn't use them.

> your working set except for the occasional brief overrun on demand.

that's all i rely on, with Plan 9.  the trouble with my just adding more memory is that
my machines are all different ages, and i have no idea which memory
to add in many cases, because the technology keeps changing.
i probably ought to have pasted a summary inside each case, but i didn't.

Linux apparently takes the Atlas approach and thrashes on demand.



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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 16:09 ` Ronald G Minnich
@ 2006-07-13 16:07   ` quanstro
  2006-07-13 17:05   ` David Leimbach
  1 sibling, 0 replies; 12+ messages in thread
From: quanstro @ 2006-07-13 16:07 UTC (permalink / raw)
  To: 9fans

otoh, on the low end with *ix, it seems to be a requirment, given how
programs are written.  on my 128MB linux box, running X and
gcc will pound the swap file.  run firefox, and i'm suprised that
the hd doesn't glow.

- erik

On Thu Jul 13 11:12:24 CDT 2006, rminnich@lanl.gov wrote:
> Brantley Coile wrote:
>
> >>From: "rob pike" <;rob@plan9.bell-labs.com>;
> >>Subject: Re: [9fans] Virtual memory in BSD and Plan9
> >>Date: Mon, 29 Oct 2001 07:38:17 -0500
> >>
> >>I'm a radical here, but I think if a machine is paging, you've lost.
>
> This has been the rule in the high end for a long time.
>
> Sadly, now that people are embedding python in their fortran apps (I am
> not making this up), they're starting to demand paging, not realizing
> what they're doing to themselves.
>
> Ah well.
>
> ron


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 14:06 ` Charles Forsyth
@ 2006-07-13 16:07   ` Ronald G Minnich
  2006-07-13 16:08     ` quanstro
  2006-08-07 17:49     ` Lluís Batlle i Rossell
  0 siblings, 2 replies; 12+ messages in thread
From: Ronald G Minnich @ 2006-07-13 16:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Charles Forsyth wrote:

>
> Linux apparently takes the Atlas approach and thrashes on demand.
>

until it starts killing random processes. Usually the wrong one. But,
hey, heuristics, right?

I think I prefer 'no swap and panic' to 'kill random processes'. I can't
differentiate between OOM killer and uncorrectable ECC errors.

Of course, the kill on no memory guck is now appearing in other places:
I can't build the myrinet tools on my machine any more, as this symbol
is not found:
/lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_PRIVATE'

oh yea. I'm loving those versioned symbols more than ever.

ron


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 16:07   ` Ronald G Minnich
@ 2006-07-13 16:08     ` quanstro
  2006-07-14 11:10       ` Paweł Lasek
  2006-08-07 17:49     ` Lluís Batlle i Rossell
  1 sibling, 1 reply; 12+ messages in thread
From: quanstro @ 2006-07-13 16:08 UTC (permalink / raw)
  To: 9fans

i typically run with 128MB real memory and 750MB of swap *used*
(out of 4G).  the oom killer hasn't been up on murder charges on my
machine yet.

- erik

On Thu Jul 13 11:12:07 CDT 2006, rminnich@lanl.gov wrote:
> Charles Forsyth wrote:
>
> >
> > Linux apparently takes the Atlas approach and thrashes on demand.
> >
>
> until it starts killing random processes. Usually the wrong one. But,
> hey, heuristics, right?
>
> I think I prefer 'no swap and panic' to 'kill random processes'. I can't
> differentiate between OOM killer and uncorrectable ECC errors.
>
> Of course, the kill on no memory guck is now appearing in other places:
> I can't build the myrinet tools on my machine any more, as this symbol
> is not found:
> /lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_PRIVATE'
>
> oh yea. I'm loving those versioned symbols more than ever.
>
> ron


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 13:52 [9fans] Swap considered harmful (Sorry) Brantley Coile
  2006-07-13 14:06 ` Charles Forsyth
@ 2006-07-13 16:09 ` Ronald G Minnich
  2006-07-13 16:07   ` quanstro
  2006-07-13 17:05   ` David Leimbach
  1 sibling, 2 replies; 12+ messages in thread
From: Ronald G Minnich @ 2006-07-13 16:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Brantley Coile wrote:

>>From: "rob pike" <;rob@plan9.bell-labs.com>;
>>Subject: Re: [9fans] Virtual memory in BSD and Plan9
>>Date: Mon, 29 Oct 2001 07:38:17 -0500
>>
>>I'm a radical here, but I think if a machine is paging, you've lost.

This has been the rule in the high end for a long time.

Sadly, now that people are embedding python in their fortran apps (I am
not making this up), they're starting to demand paging, not realizing
what they're doing to themselves.

Ah well.

ron


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

* Re: Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 16:09 ` Ronald G Minnich
  2006-07-13 16:07   ` quanstro
@ 2006-07-13 17:05   ` David Leimbach
  1 sibling, 0 replies; 12+ messages in thread
From: David Leimbach @ 2006-07-13 17:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/13/06, Ronald G Minnich <rminnich@lanl.gov> wrote:
> Brantley Coile wrote:
>
> >>From: "rob pike" <;rob@plan9.bell-labs.com>;
> >>Subject: Re: [9fans] Virtual memory in BSD and Plan9
> >>Date: Mon, 29 Oct 2001 07:38:17 -0500
> >>
> >>I'm a radical here, but I think if a machine is paging, you've lost.
>
> This has been the rule in the high end for a long time.

And I think Ron Brightwell would agree with you both (Yeah, I used to
work on CPlant from time to time)

>
> Sadly, now that people are embedding python in their fortran apps (I am
> not making this up), they're starting to demand paging, not realizing
> what they're doing to themselves.
>

(vomits in terror!)

That sounds insane.

> Ah well.
>
> ron
>


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 16:08     ` quanstro
@ 2006-07-14 11:10       ` Paweł Lasek
  2006-07-14 11:54         ` quanstro
  0 siblings, 1 reply; 12+ messages in thread
From: Paweł Lasek @ 2006-07-14 11:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/13/06, quanstro@quanstro.net <quanstro@quanstro.net> wrote:
> i typically run with 128MB real memory and 750MB of swap *used*
> (out of 4G).  the oom killer hasn't been up on murder charges on my
> machine yet.

The only time I had seen OOM-killer running was when I invoked it
directly by SysRq combo. I had once reached full memory and swap, but
even then OOM-killer didn't run - I am not sure if 2.6.x line didn't
changed the default behaviour, as the only think that happened was gcc
complaining "Out of Memory" during compilation of Open Office (never
more - I have given up and used binaries and OTOH, for my own works I
mostly use TeX) and killing itself.

And swap had given me enough to not remove it - and on linux,
strangely, even on systems with godlike amounts of memory, small swap
was found to be a good choice (Something about caching/mapping and so
on).

And as for Plan9... when you have at most 40 MB, swap is a good idea :)

--
Paul Lasek


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-14 11:10       ` Paweł Lasek
@ 2006-07-14 11:54         ` quanstro
  2006-07-14 19:40           ` Paweł Lasek
  0 siblings, 1 reply; 12+ messages in thread
From: quanstro @ 2006-07-14 11:54 UTC (permalink / raw)
  To: 9fans

On Fri Jul 14 06:11:12 CDT 2006, pawel.lasek@gmail.com wrote:
> And swap had given me enough to not remove it - and on linux,
> strangely, even on systems with godlike amounts of memory, small swap
> was found to be a good choice (Something about caching/mapping and so
> on).

it used to be solaris (i don't know if this is still the case) would
evict pages to swap even when used + cache << phys memory.
i did quite a bit of performance work on solaris, and found i couldn't
use more than a fraction of available memory.  we moved the same
applications to aix and got much better performance with the same amount
of physical memory, as we were memory bound.

- erik


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-14 11:54         ` quanstro
@ 2006-07-14 19:40           ` Paweł Lasek
  0 siblings, 0 replies; 12+ messages in thread
From: Paweł Lasek @ 2006-07-14 19:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/14/06, quanstro@quanstro.net <quanstro@quanstro.net> wrote:

> it used to be solaris (i don't know if this is still the case) would
> evict pages to swap even when used + cache << phys memory.
> i did quite a bit of performance work on solaris, and found i couldn't
> use more than a fraction of available memory.  we moved the same
> applications to aix and got much better performance with the same amount
> of physical memory, as we were memory bound.

IIRC, the performance increase from swap on linux is in IO code, which
used swap as a sort of organized buffer for apps or something like it,
while giving more core to apps. Not sure about this, I'd have to check
archives for that. It was in a discussion about whether prepare swap
when you have such amounts of memory as today :)

> - erik
>


--
Paul Lasek


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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-07-13 16:07   ` Ronald G Minnich
  2006-07-13 16:08     ` quanstro
@ 2006-08-07 17:49     ` Lluís Batlle i Rossell
  2006-08-07 18:13       ` Sascha Retzki
  1 sibling, 1 reply; 12+ messages in thread
From: Lluís Batlle i Rossell @ 2006-08-07 17:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

Ronald G Minnich wrote:
> Charles Forsyth wrote:
> 
>>
>> Linux apparently takes the Atlas approach and thrashes on demand.
>>
> 
> until it starts killing random processes. Usually the wrong one. But,
> hey, heuristics, right?

Maybe you already know, but by change I got into the linux malloc(3)
manpage, and I found its BUGS section:


BUGS
       By default, Linux follows an  optimistic  memory  allocation
strategy.
       This  means  that  when malloc() returns non-NULL there is no
guarantee
       that the memory really is available. This is a really bad bug.
In case
       it  turns  out  that the system is out of memory, one or more
processes
       will be killed by the infamous OOM killer.  In case Linux  is
employed
       under  circumstances  where it would be less desirable to
suddenly lose
       some randomly picked processes, and moreover the kernel version
is suf-
       ficiently recent, one can switch off this overcommitting behavior
using
       a command like
              # echo 2 > /proc/sys/vm/overcommit_memory

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3311 bytes --]

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

* Re: [9fans] Swap considered harmful (Sorry)
  2006-08-07 17:49     ` Lluís Batlle i Rossell
@ 2006-08-07 18:13       ` Sascha Retzki
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Retzki @ 2006-08-07 18:13 UTC (permalink / raw)
  To: 9fans


> 
> 
> BUGS
>        By default, Linux follows an  optimistic  memory  allocation
> strategy.
>        This  means  that  when malloc() returns non-NULL there is no
> guarantee
>        that the memory really is available. 


Haha

Nice!

Yeah, I once saw a linux-kernel kill random(!) processes because there was no memory - there seems to have been some memory leak, it started right in the boot-processes to kill all services (sshd, apache, mysql, etc), killed the vt-emulators (those login:-processes on alt+Fn), init, everything, then paniced because there was no init anymore. It was great cinema.



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

end of thread, other threads:[~2006-08-07 18:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 13:52 [9fans] Swap considered harmful (Sorry) Brantley Coile
2006-07-13 14:06 ` Charles Forsyth
2006-07-13 16:07   ` Ronald G Minnich
2006-07-13 16:08     ` quanstro
2006-07-14 11:10       ` Paweł Lasek
2006-07-14 11:54         ` quanstro
2006-07-14 19:40           ` Paweł Lasek
2006-08-07 17:49     ` Lluís Batlle i Rossell
2006-08-07 18:13       ` Sascha Retzki
2006-07-13 16:09 ` Ronald G Minnich
2006-07-13 16:07   ` quanstro
2006-07-13 17:05   ` David Leimbach

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