Re: [PATCH] generic_file_sendpage

From: Linus Torvalds
Date: Fri Jul 15 2005 - 11:11:52 EST




On Fri, 15 Jul 2005, Jan Engelhardt wrote:
>
> >> I don't know if we want to add this feature, really. It's such a
> >> specialised thing.
> >
> >With union mount and cowlink, there are two users already. cp(1)
> >could use it as well, even if the improvement is quite minimal.
>
> FTP PUT could use this too - currently, only FTPGETs can use sendfile because
> the target had to be a socket.
> (With FTP PUT, the src is a sock, dst is a filedescriptor.)

No, FTP PUT _cannot_ use it, exactly because sendfile() can't do anything
but file sources (and not even all file sources - it can only do regular
filesystems that use the page cache).

This is why I want to get rid of sendfile(). It's a fundamentally broken
interface. Really. In contrast, the pipe buffers _can_ be used for direct
socket->file interfaces.

Now, even pipe buffers obviously won't actually be really "zero-copy":
you'll end up needing one copy to align the result, since the incoming
network packets will obviously not be nice page-sized and page-aligned
things. But they won't need the "copy to user space" and "copy back from
user space into kernel space", so it will be a question of _minimal_ copy
(and avoiding unnecessary user space VM work).

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/