mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kalvatchev <iive@yahoo.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: kernelbug <linux-kernel@vger.kernel.org>,
	Andrey Savochkin <saw@saw.sw.com.sg>,
	Szabolcs Szakacsits <szaka@f-secure.com>
Subject: if (malloc() == HORROR_WITHIN) BUG();
Date: Thu, 23 Aug 2001 06:55:14 -0700 (PDT)	[thread overview]
Message-ID: <20010823135514.93176.qmail@web13601.mail.yahoo.com> (raw)


Actually i cannot understand how this "optimistic
memory allocation strategy" works. 
It is normal all requested memory to be allocated
before malloc returns any result. At this moment it
seem to be something like alloc on demand, and this
requires special flag, otherwise there gonna be
CoreDump.
I don't have glibc sources but i assume that malloc is
translated to vmalloc.
Malloc should be able to alloc pages in ram and swap.
Currently the memory management seems to be separated
in two independent parts, RAM management and swap
transfer. Instead of working as one, the swap is used
to keep amount of pages free. In this situation it is
impossible to make correct routine that allocates more
memory than are available as free pages. And even
worse, kswapd is called 0.5 times per second, or on
page fault. At least it should be linked with routines
that allocate memory. But in this implementation the
effect could be negative. More, kswapd is used to
reduce buffer and cache.

 The 2.4.x memory management should be fixed now. 
The quick fix could be to use
mm/mmap::vm_enough_memory, to check amount of free
pages in vmalloc. The strange thing is that this
function is used in shmem.c that hold tmpfs. So
please, synchronize this with
mm/oom_kill.c::out_of_memory. And please don't balance
things out, be more paranoid.
I first thought to use out_of_memory (with some
tweaking) to check vmalloc, because this will force
use of oom_kill only after huge kmalloc.
This optimistic allocation should be removed , because
there are some horrible workarounds for this. 
About the beancounter: I don't know this algorithm,
but i don't need group based resources accounting. For
me the things are simple - give memory if there is
any. If there is not don't give loans, Linux is not a
bank!!!! :)

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

             reply	other threads:[~2001-08-23 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-23 13:55 Ivan Kalvatchev [this message]
2001-08-23 14:41 ` Rik van Riel

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=20010823135514.93176.qmail@web13601.mail.yahoo.com \
    --to=iive@yahoo.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saw@saw.sw.com.sg \
    --cc=szaka@f-secure.com \
    /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

all inboxes | Powered by JetHome®