public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ihar 'Philips' Filipau" <filia@softhome.net>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Rik van Riel <riel@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?
Date: Wed, 26 Nov 2003 13:14:54 +0100	[thread overview]
Message-ID: <3FC4993E.1010000@softhome.net> (raw)
In-Reply-To: <20031126103957.GK8039@holomorphy.com>

William Lee Irwin III wrote:
> Rik van Riel wrote:
> 
>>>Strict non-overcommit mode.  You can allocate as much
>>>non-file-backed virtual memory as will fit in swap,
>>>plus /proc/sys/vm/overcommit_percentage worth of memory.
> 
> 
> On Wed, Nov 26, 2003 at 11:30:23AM +0100, Ihar 'Philips' Filipau wrote:
> 
>>  [ s/overcommit_percentage/overcommit_ratio/ ]
>>  Thanks! On 2.6 it works as expected. Test with two concurrent memory 
>>allocations took some time, but both apps stops exactly when memory was 
>>depleted. Great.
>>  Did rmap has something todo with this?
>>  As I see from implementation of do_mmap_pgoff() - it changed from 2.4 
>>to 2.6 - but there are a lot of common things.
>>  If I will do dumb back port of this check to 2.4 - do you think it 
>>will work? 2.4->2.6 memory accounting changed?
>>  I didn't found this check in your rmap patches for 2.4.22. (btw 
>>thanks for keeping them up-to-date).
> 
> 
> In principle, non-overcommit shouldn't be dependent on rmap, as it
> largely consists of keeping track of the sum of MAP_PRIVATE virtual
> mappings' sizes and refusing them when they exceed RAM + swap.
> 

   That's the point of my question. I know a few about MM in Linux. As I 
understand memory accounting is most complicated: 1st how to account 
kernel allocatable memory, 2nd how to reliably calculate already 
allocated memory. (1st looks like not present even in 2.6, 2nd not 
present in 2.4.)

   As I understood, default overcommit_ratio=90% is made especially to 
protect kernel from running out of memory. And 2.6 does offset available 
memory by 3% for all non-root allocation checks.

   But I cannot find any similar accounting stuff in 2.4...
   Hard to draw parallels.

   Will appreciate any advice.

-- 
Ihar 'Philips' Filipau  / with best regards from Saarbruecken.
--                                                           _ _ _
  Because the kernel depends on it existing. "init"          |_|*|_|
  literally _is_ special from a kernel standpoint,           |_|_|*|
  because its' the "reaper of zombies" (and, may I add,      |*|*|*|
  that would be a great name for a rock band).
                                 -- Linus Torvalds


  reply	other threads:[~2003-11-26 12:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VQJL.62Q.11@gated-at.bofh.it>
     [not found] ` <VR3c.6Ns.21@gated-at.bofh.it>
2003-11-26 10:30   ` 2.2/2.4/2.6 VMs: do malloc() ever return NULL? Ihar 'Philips' Filipau
2003-11-26 10:39     ` William Lee Irwin III
2003-11-26 12:14       ` Ihar 'Philips' Filipau [this message]
     [not found] <VLAm.2g1.9@gated-at.bofh.it>
     [not found] ` <VM3n.3jY.9@gated-at.bofh.it>
2003-11-25 15:23   ` Ihar 'Philips' Filipau
2003-11-25 13:27 Ihar 'Philips' Filipau
2003-11-25 14:00 ` Arjan van de Ven
2003-11-25 16:58 ` Rik van Riel
2003-11-25 19:03   ` Ihar 'Philips' Filipau
2003-11-25 19:24     ` Rik van Riel
2003-11-25 19:28     ` Chris Wright
2003-11-25 20:17 ` Richard B. Johnson
2003-11-25 23:17   ` Ihar 'Philips' Filipau
2003-11-25 23:40     ` Oliver
2003-11-26 13:06     ` Richard B. Johnson
2003-11-26 13:20       ` Ihar 'Philips' Filipau
2003-11-26 13:27         ` William Lee Irwin III
2003-11-26 14:33           ` Ihar 'Philips' Filipau
2003-11-26 14:36             ` William Lee Irwin III
2003-11-26 13:49         ` Richard B. Johnson
2003-11-26 14:39           ` Ihar 'Philips' Filipau
2003-11-26  7:31   ` Tim Connors
2003-11-26  9:58     ` William Lee Irwin III

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=3FC4993E.1010000@softhome.net \
    --to=filia@softhome.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=wli@holomorphy.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