Re: [PATCH][RFC] splice support

From: Nick Piggin
Date: Thu Mar 30 2006 - 11:44:58 EST


Jens Axboe wrote:
On Thu, Mar 30 2006, Nick Piggin wrote:

Moving a page from a pipe to a filesystem might be harder, because you
don't know if it came from a filesystem (still on LRU) or not (in which
case you need to add it to LRU). If only you can keep track of this


Well that, to me, is _the_ hard problem to solve for this. But you
sort-of do know, my plan is/was to add a ->steal() hook to the pipe
buffers that would 'unhook' the page so it was in a clean state to be
added to the LRU/page cache again. If stealing failed, just fall back to
copying (or hard error, let the flags decide).

Yeah, that's probably best to start with. If 'gift' copies become
widely used and performance critical we can look at tricks to speed
it up further (not that this way would be particularly slow itself).

My first thought is that falling back to copying would be the best
idea, because otherwise you can get random failures for any number of
reasons (dirty pages, page reclaim, migration, get_user_pages, etc).
If a future usage wants an error, we could add an extra flag?


Unless someone beats me to it, I'll try coding something up when I get
a bit more free time.


You are more than welcome, I hope to give it a little shot today and see
how it goes.

Sure, I wouldn't get around to it for a while yet anyway, but I'd be
happy to review your patch if you do it earlier.

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
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/