>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  >> obviously gets called for memalign - at least for this arena size)
  >> does clear the memory.  We need some tests, from which size memory is
  >> cleard for malloc and memalign.
  >> I tossed the memset for now and saved ~450.000 L2-misses or ~0.2 s.

  DS> While I didn't see any memsets in smallobject.c, I'm really, *really*
  DS> uncomfortable counting on implied behavior. There's no reason that
  DS> mmap has to return zeroed memory, and none of the man pages I have
  DS> claim that it does. While it *probably* does, it certainly doesn't
  DS> have to, and I'd definitely not count that it does, nor that it's
  DS> actually called implicitly. I've been burned by stuff like that before.

you can mmap chunks from /dev/zero and get the behavior you want. it
shouldn't do any L1 stuff until you reference the actual pages and then
they will be zero filled for you on demand. i also don't recall mmap
ever guaranteeing any level of cleanliness.

solaris says this about /dev/zero:

     Mapping a  zero  special  file  creates  a  zero-initialized
     unnamed memory object of a length equal to the length of the
     mapping and rounded up to the nearest page size as  returned
     by sysconf.

linux says nothing about mmap on /dev/zero in either man page.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to