On Tue, Oct 22, 2002 at 12:48:03PM -0700, Terry Lambert wrote: > Tony Finch wrote: > > > > Linux [clears memory in the kernel before handing it over to > > userland], 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.
The only significant difference I can see is that large callocs are mmapped by gnu malloc which doesn't then re-clear them, whereas phk malloc only mmaps its page table (not memory returned to the user) so calloc always clears memory, which happens to be redundant if the pages have just come from brk (which isn't always the case). However calloc isn't relevant to this benchmark. [If you are talking about a different difference, perhaps you should say what it is so that this thread doesn't get even more unnecessarily long.] > You are arguing that there is nothing that can account for the > performance difference, when in fact there is a measured > performance difference. No, I'm saying that some of what you said is either wrong or misleading, and the comment about security was especially stupid. > > 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? Exactly the same, and it uses MAP_ANONYMOUS on Linux. It uses mmap for large allocations whereas phk malloc does not. Since both mmap and sbrk get zero-filled pages from the kernel this shoudld make little difference, except in the calloc case explained above. Tony. -- f.a.n.finch <[EMAIL PROTECTED]> http://dotat.at/ FORTIES CROMARTY: EAST BECOMING CYCLONIC 7 TO SEVERE GALE 9, OCCASIONALLY STORM 10 LATER. RAIN. MODERATE OR POOR. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message