Re: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?

From: Ihar 'Philips' Filipau (filia_at_softhome.net)
Date: 11/26/03

  • Next message: William Lee Irwin III: "Re: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?"
    Date:	Wed, 26 Nov 2003 11:30:23 +0100
    To: Rik van Riel <riel@redhat.com>
    
    

    Rik van Riel wrote:
    > On Tue, 25 Nov 2003, Ihar 'Philips' Filipau wrote:
    >
    >
    >>># echo 2 > /proc/sys/vm/overcommit_memory
    >>>
    >>>Then try again.
    >>
    >> What do you know what is not said in docs?
    >> What '2' means?
    >
    > 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.
    >

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

    -- 
    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: William Lee Irwin III: "Re: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?"

    Relevant Pages

    • Re: [ANNOUNCE] Minneapolis Cluster Summit, July 29-30
      ... > have them allocate 1MB in to free some memory. ... allocating lots of memory from the lower reservations. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] oom-killer sysrq-f fix
      ... > we just let oom-killer send SIGKILL in interrupt context and return. ... allocate any memory. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC] SPI core -- revisited
      ... userspace to spi-dev, spi-dev should allocate memory and copy the user ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Latency data - 2.6.14-rc3-rt13
      ... I guess my apps don't allocate enough memory to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Is there a maximum contiguous memory allocation?
      ... but could ALLOCATE it! ... allocate it if I had 2GB of physical memory! ... the amount of physical memory I have installed. ... Note that you can use raw VirtualAlloc to improve your ...
      (microsoft.public.vc.mfc)