This is the mail archive of the
mailing list for the glibc project.
Re: [patch] Fix BZ#16374 -- don't use mmap for FILE buffers
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 16 Feb 2015 21:10:01 +0100
- Subject: Re: [patch] Fix BZ#16374 -- don't use mmap for FILE buffers
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobNomWyxd9Oz3=kHq0vyBpmfxSyj_cFBxyahCJSs1cZBzQ at mail dot gmail dot com> <54E236D9 dot 3010807 at redhat dot com> <CALoOobPVr0PAkzDtQbXXGP7Vyu-Ls+V-1JGXpi8yBbyryqYf5g at mail dot gmail dot com>
On 02/16/2015 07:51 PM, Paul Pluzhnikov wrote:
> On Mon, Feb 16, 2015 at 10:32 AM, Florian Weimer <email@example.com> wrote:
>>> Attached patch replaces mmap()s with calloc()s.
>> Why is calloc needed?
> In previous discussion it was mentioned that something was expecting
> the buffers to be zero'ed out, but you are right -- fallback used
> malloc and calloc shouldn't be necessary (this should nicely speed
> things up on systems with large pages :)
I think it will still be a net win, but fopen/fclose pairs might now run
into the issue discussed in the âReduce worst-case behaviour with
madvise and refault overheadâ thread. :-P
Florian Weimer / Red Hat Product Security