From: Christophe R. <cs...@ca...> - 2005-08-04 08:00:08
|
Dave Roberts <ld...@dr...> writes: > Hi, Rob, > > On Wed, 2005-08-03 at 07:53 -0400, Rob MacLachlan wrote: >> Maybe nobody is worried about this kind of efficency issue anymore, but >> I don't like the idea of relocating the heap on two grounds: >> 1] the startup time required to relocate everything > > This is no more than the GC time of the memory occupied by the core > file, right? Where everything is live, and everything has to be copied, yes. > My sense is that this isn't too big of a deal. Yes, it is > more time than if you avoid it, but I'm not sure how you can avoid it > given that memory randomization is quickly going to become a standard > feature on at least Linux. And as soon as Linux has it, I would expect > all the various BSDs to quickly follow, etc. Well, firstly, an allocation algorithm which relies on having a large amount of contiguous space (such as one supporting a simple semispace garbage collector) is doomed in this brave new world of memory randomization -- it is perfectly possible that, on a given run, there would not be room _at all_ in the address space to put a 512Mb heap, let alone the 1.5Gb heaps that I hear people want to use with SBCL. From where I'm sitting, the inability to turn off randomization per-process, or to customize the randomness, is therefore a terrible misfeature: defeating perfectly reasonable programs before they've even started. If the answer to this is having to play ELF games with our executable, to reserve space before the kernel and linker decide where they're going to live and to put shared libraries, then so be it; something akin to Brian Mastenbrook's ELF-grovelling Darwin trick can probably be adapted, no? This doesn't mitigate the fact that I think that default address-space randomization is a terrible idea; and that linker scripts aren't supported enough for what we need to do (see our linker script for Alpha/linux, which works with some versions of ld and not others). But if we can grovel over our executable to tell the Operating System to keep its hands off bits of our address space, then that sounds like a reasonable workaround for questionable OS decisions (if we can't, then it might be time to find an even more niche OS...) Cheers, Christophe |