Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2002 12:48:03 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Tony Finch <dot@dotat.at>
Cc:        hackers@freebsd.org
Subject:   Re: malloc
Message-ID:  <3DB5AB73.E334629@mindspring.com>
References:  <E183u5Y-0003Yc-00@cse.cs.huji.ac.il> <E183xYK-0003aB-00@chiark.greenend.org.uk> <3DB5A07F.AA118FA6@mindspring.com> <20021022202533.A29425@chiark.greenend.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Tony Finch wrote:
> > > >The FreeBSD malloc guarantees that the pages are zeroed before being
> > > >obtained from the system; this is probably the majority of the cost.
> > > >It is a security measure, so that you do not leak data from one process
> > > >to another through anonymous pages.
> > > >
> > > >The Linux malloc does not.
[ ... ]
> >
> > *before being obtained from the system*.
> 
> Linux does that too, and you appeared to be saying that it doesn't which
> is clearly wrong for the security reasons that you stated. It therefore
> won't affect the relative performance.

Yes, it will.  It has to do with the use of anonymous memory
being different between the systems.

You are arguing that there is nothing that can account for the
performance difference, when in fact there is a measured
performance difference.


> > And I didn't say that.  I only said that the pages were zeroed *before
> > being obtained from the system*.  This is what you would expect, with
> > anonymous memory accessed off /dev/zero.
> 
> PHK malloc uses MAP_ANON on FreeBSD, not /dev/zero -- it uses the
> latter only if compiled for Solaris.

And tell me, what does the Linux malloc use?

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DB5AB73.E334629>