On Mon, Sep 26, 2016 at 2:23 PM, Rik van Riel <riel@xxxxxxxxxx> wrote: > > Why are we touching file pages at all during fork()? This is *not* fork. This is fork/exec/exit. It's a real load, it's just fairly concentrated by the scripts being many and small. It's easy enough to try yourself: perf record -e cycles:pp make -j16 test in the git tree. > Could we get away with skipping copy_page_range on VMAs > that do not have any anonymous pages? You still have to duplicate those ranges, but that's fairly cheap. >From what I can tell, the expensive part really is the "page in new executable/library pages" and then tearing them down again (because it was just a quick small git process or a very small shell script). So forget about fork(). I'm not even sure how much of that there is, it's possible that you end up having vfork() instead. It's exec/exit that matters most in this load. (You can see that in the profile with things like strnlen_user() actually being fairly high on the profile too - mostly the environment variables during exec). Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>