Re: Zeroed pages returned for heap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 7 Jun 2005, Ulrich Drepper wrote:

> On 6/6/05, Nagendra Singh Tomar <[email protected]> wrote:
> > Is it OK for an application (a C library implementing malloc/calloc is
> > also an application) to assume that the pages returned by the OS for heap
> > allocation (either directly thru brk() or thru mmap(MAP_ANONYMOUS)) will
> > be zero filled.
> 
> The malloc code is glibc is defined with the assumption that brk
> clears memory.  Since this is what the kernel implements it would be a
> horrible waste of time to reinitialize the memory.  This behavior is
> part of the kernel ABI and cannot be changed without breaking existing
> applications without producing new libc DSOs (set MORECORE_CLEARS
> appropriately) and relinking all statically linked apps.


glibc behaviour is completely justified, but when you are dealing with 
Xscale memory access limitations you wish it was not like that and just 
disabling zeroing brk/anonymous pages in kernel could get you a good bump 
in performance.
Anyway, thanx for the insight.



-- You have moved the mouse. Windows must be restarted for the 
   changes to take effect.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux