|
Message-ID: <20140401170157.GC3034@port70.net> Date: Tue, 1 Apr 2014 19:01:58 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: Proposed approach for malloc to deal with failing brk * Vasily Kulikov <segoon@...nwall.com> [2014-04-01 20:40:57 +0400]: > On Sun, Mar 30, 2014 at 20:41 -0400, Rich Felker wrote: > > We want brk. This is not because "brk is faster than mmap", but > > because it takes a lot of work to replicate what brk does using mmap, > > and there's no hope of making a complex dance of multiple syscalls > > equally efficient. My best idea for emulating brk was to mmap a huge > > PROT_NONE region and gradually mprotect it to PROT_READ|PROT_WRITE, > > What problem do you try to solve via PROT_NONE -> PROT_WRITE? Why not writable page is commit charge and that matters with a huge mmap on systems with no overcommit > simply instantly mmap it as PROT_WRITE? Linux will not allocate physical pages > until the first access, so you don't lose physical memory when it is not > actually used.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.