Actually, less than you think.
>So I sat down and wrote a new copy_page_range without inlining.
I liked your version, and I actually even applied the patch for about
five minutes, until I noticed that you actually optimized away a few
rather important things.
Your copy_page_range() doesn't actually work correctly. It breaks badly
when it hits a sparse region that doesn't have pmd's or pgd's. Look at
what happens to "address" for that case: not only does it get
incorrectly updated (ie not at all), but it also never gets tested
against "end", so the thing can potentially start doing strange things
to kernel mappings etc.
But if you can fix the problems and keep it readable enough that I can
trust that they really are gone I'd be more than happy to apply
something like this patch. I'm not all that excited about the code gcc
generates for the current code either.
Linus