public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephan von Krawczynski <skraw@ithnet.com>
To: Daniel Phillips <phillips@bonn-fries.net>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Memory Problem in 2.4.10-pre2 / __alloc_pages failed
Date: Fri, 31 Aug 2001 12:32:47 +0200	[thread overview]
Message-ID: <20010831123247.357bd4cd.skraw@ithnet.com> (raw)
In-Reply-To: <20010830175615Z16280-32384+1119@humbolt.nl.linux.org>
In-Reply-To: <20010829140706.3fcb735c.skraw@ithnet.com> <20010829232929Z16206-32383+2351@humbolt.nl.linux.org> <20010830164634.3706d8f8.skraw@ithnet.com> <20010830175615Z16280-32384+1119@humbolt.nl.linux.org>

On Thu, 30 Aug 2001 20:02:55 +0200
Daniel Phillips <phillips@bonn-fries.net> wrote:

> In essence, the memory isn't consumed, it's bound to data.  Once we have
> data sitting on a page it's to our advantage to try to keep the page
> around as long as possible so it doesn't have to be re-read if we need it
> again.  So the normal situation is, we run with as little memory actually
> free and empty of data as possible, around 1-2%.
> 
> But there's a distinction between "free" and "freeable".  Of the remaining
> 98% of memory, most of it is freeable.  This is fine if your memory
> request is able to wait for the vm to go out and free some.  This happens
> often, and while the preliminary scanning work is being done the system
> tends to sit there in its absolute rock-bottom memory state (zone->pages
> == zone->min).  Along comes an interrupt with a memory allocation request
> and it must fail, because it can't wait.

Well, I do understand the strategy, only I tend to believe it is bs. The reason is pretty simple: with this strategy you cannot even add physical memory to your host if it runs low, because the system "uses" it for caching that is _mostly not needed_. No matter how much money you spend, you will always run low on memory and will always have allocation failures -  and performance drawbacks because of this. This _is_ bs. Furthermore your 1-2% free mem obviously doesn't take into account mem fragmentation. I checked my setup and found out that I really do have around 30 MB free mem, but sg driver fails to allocate ridiculous 32 KB. Tell me honestly: do you think this makes sense?
There is another thing that is not taken into account: how is the runtime situation while performing mem functions?
What I want to say, I would suspect it to be more probable that it is generally less time critical to do a _free_ than to do an _alloc_. On _allocs_ somebody needs mem and possibly _waits_ for actions to be done. On _free_ it is far more possible that you are in a cleanup and exit situation. But your strategy moves the work to be done from _free_ situation to _alloc_ situation meaning strategically you have to wait longer, although maybe _alloc_ and _free_ take the same time summed up. A quick and handsome system should give away mem _fast_ and cleanup things when a user _expects_ a cleanup, and not vice versa.
This looks like w*doze to me: do the wrong thing at the wrong time.

> > Uh, I would not do that. To a shared memory pool system this is really 
> > contra-productive (is this english?). You simply let the mem vanish in some 
> > private pools, so only _one_ process (or whatever) can use it.
> 
> It's not very much memory, that's the point.  But it sure hurts if it's not
> available at the time it's needed.

Well, you name it.

> Keep in mind we're solving an impossible problem here.  We have a task that
> can't wait, but needs an unknown (to the system) amount of memory.  We dance
> around this by decreeing that the allocation can fail, and the interrupt
> handler has to be able to deal with that.  Well, that works, but often not
> very fast.  In the network subsystem it translates into dropped packets.
> That's very, very bad if it happens often.  So it's ok to use a little memory
> in a less-than-frugal way if we reduce the frequency of packet dropping.

AHHHH! That really hurt me! Can't you see how this hurts: you buy _lots_ of mem, and anyway the system merely throws it away and drops pakets anyway, because it runs out of mem. "Help me if you can I'm feeling down, down!" (Lennon/McCartney). 
There is nothing impossible about this situation, only what vm makes out of it. Running a simple NFS-server with _one_ client runs out of mem on a server with 1 GB! And the best about it, it would be just the same if I had 2 GB!
Well, maybe that is in fact the reason for the problems of DRAM producers, nobody needs to buy it anymore: it does not help anyway.

Regards,
Stephan

  reply	other threads:[~2001-08-31 10:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-29 12:07 Memory Problem in 2.4.10-pre2 / __alloc_pages failed Stephan von Krawczynski
2001-08-29 16:47 ` Roger Larsson
2001-08-29 19:18   ` Stephan von Krawczynski
     [not found]     ` <Pine.LNX.4.33.0108300521280.448-100000@mikeg.weiden.de>
2001-08-30 14:16       ` Stephan von Krawczynski
2001-08-29 23:36 ` Daniel Phillips
2001-08-30 14:46   ` Stephan von Krawczynski
2001-08-30 18:02     ` Daniel Phillips
2001-08-31 10:32       ` Stephan von Krawczynski [this message]
2001-08-30 23:53     ` [PATCH] __alloc_pages cleanup -R6 Was: " Roger Larsson
2001-08-31  7:43       ` Russell King
2001-08-31 23:22         ` Roger Larsson
2001-08-30 16:49   ` Roger Larsson
2001-08-31 11:06   ` Stephan von Krawczynski
2001-08-31 19:03     ` Daniel Phillips
  -- strict thread matches above, loose matches on Subject: below --
2001-09-01 18:28 Stephan von Krawczynski
2001-09-02  1:57 ` Daniel Phillips
2001-09-02  2:21   ` Roger Larsson
2001-09-02  4:16     ` Daniel Phillips
2001-09-02 13:48     ` Alex Bligh - linux-kernel
2001-09-02 18:26       ` Daniel Phillips
2001-09-02 19:32         ` Alex Bligh - linux-kernel
2001-09-02 20:24           ` Daniel Phillips
2001-09-02 21:03             ` Alex Bligh - linux-kernel
2001-09-02 20:33           ` Daniel Phillips
2001-09-02 21:14             ` Alex Bligh - linux-kernel
2001-09-02 21:23           ` Daniel Phillips
2001-09-02 21:28             ` Alex Bligh - linux-kernel
     [not found] <20010901055634Z16057-32383+2785@humbolt.nl.linux.org>
     [not found] ` <Pine.LNX.4.33.0109011021570.280-100000@mikeg.weiden.de>
2001-09-01 18:54   ` Stephan von Krawczynski
2001-09-02  3:21     ` Mike Galbraith
     [not found] <20010907154801.028a48e8.skraw@ithnet.com>
     [not found] ` <689208719.999883299@[10.132.112.53]>
2001-09-07 21:13   ` Stephan von Krawczynski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010831123247.357bd4cd.skraw@ithnet.com \
    --to=skraw@ithnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@bonn-fries.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox