Re: Downsides to madvise/fadvise(willneed) for application startup

From: Theodore Tso
Date: Fri Apr 16 2010 - 08:23:29 EST


On Apr 16, 2010, at 7:41 AM, Andi Kleen wrote:

> Zan Lynx <zlynx@xxxxxxx> writes:
>
>> On 4/15/10 4:53 PM, Andrew Morton wrote:
>>
>>> This just isn't an interesting case. World-wide, the number of people
>>> who compile their own web browser and execute it from the file which ld
>>> produced is, umm, seven.
>>
>> Gentoo users? Linux From Scratch?
>
> "make install" tends to copy. I am not aware of any Makefiles
> that link directly to /usr/bin, and usually that wouldn't work
> anyways because of permissions. copy fixes the problem.

... and those people who are executing the binary out of the build directory are probably running the regression test (i.e., "make; make check") and on most developer machines, if they're lucky they have enough memory that the executable will still be in their page cache. :-)

This being said, on modern file systems (i.e., btrfs, ext4, xfs, et. al), delayed allocation should mostly hide this problem; and if not, and the linker can estimate in advance how big the resulting binary will be, it could be modified to use the fallocate(2) system call.

-- Ted


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/