Re: [PATCH 1/2] Introduce copy_user_handle_tail routine

From: Linus Torvalds
Date: Thu Jul 03 2008 - 04:18:02 EST




On Wed, 2 Jul 2008, Vitaly Mayatskikh wrote:
>
> Linus wanted this routine to be extremely dumb.

Well, I wanted it simple and dumb, but not dumber than _necessary_.

I think

if (cleartail)
memset(dst,0,len);
return len;

is basically what we should have at the end. Simple and sweet.

Now, the stuff that comes *before* that point is the "try to fix up one
byte at a time" thing, which I'd like to be simple and dumb. At least to
start with.

Of course, I also suspect that *eventually* we might want to make it
smarter and more complex. For example, while performance isn't a primary
issue, we might want to eventually avoid having to do _two_ faults (once
in the fast unrolled or word-at-a-time loop, and once in the byte-for-byte
one), by limiting the byte-for-byte one to be within a page, but that
would be a "future enhancement" thing.

Linus
--
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/