Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556Ab3JAT67 (ORCPT ); Tue, 1 Oct 2013 15:58:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39621 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751209Ab3JAT64 (ORCPT ); Tue, 1 Oct 2013 15:58:56 -0400 Date: Tue, 1 Oct 2013 12:58:17 -0700 From: Zach Brown To: Miklos Szeredi Cc: Ric Wheeler , "J. Bruce Fields" , "Myklebust, Trond" , Anna Schumaker , Kernel Mailing List , Linux-Fsdevel , "linux-nfs@vger.kernel.org" , "Schumaker, Bryan" , "Martin K. Petersen" , Jens Axboe , Mark Fasheh , Joel Becker , Eric Wong Subject: Re: [RFC] extending splice for copy offloading Message-ID: <20131001195817.GE10831@lenny.home.zabbo.net> References: <20130927200550.GA22640@fieldses.org> <20130927205013.GZ30372@lenny.home.zabbo.net> <4FA345DA4F4AE44899BD2B03EEEC2FA9467EF2D7@SACEXCMBX04-PRD.hq.netapp.com> <52474839.2080201@redhat.com> <20130930143432.GG16579@fieldses.org> <52499026.3090802@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1469 Lines: 33 > - app calls splice(from, 0, to, 0, SIZE_MAX) > 1) VFS calls ->direct_splice(from, 0, to, 0, SIZE_MAX) > 1.a) fs reflinks the whole file in a jiffy and returns the size of the file > 1 b) fs does copy offload of, say, 64MB and returns 64M > 2) VFS does page copy of, say, 1MB and returns 1MB > - app calls splice(from, X, to, X, SIZE_MAX) where X is the new offset (It's not SIZE_MAX. It's MAX_RW_COUNT. INT_MAX with some PAGE_CACHE_SIZE rounding noise. For fear of weird corners of fs code paths that still use int, one assumes.) > The point is: the app is always doing the same (incrementing offset > with the return value from splice) and the kernel can decide what is > the best size it can service within a single uninterruptible syscall. > > Wouldn't that work? It seems like it should, if people are willing to allow splice() to return partial counts. Quite a lot of IO syscalls technically do return partial counts today if you try to write > MAX_RW_COUNT :). But returning partial counts on the order of a handful of megs that the file systems make up as the point of diminishing returns is another thing entirely. I can imagine people being anxious about that. I guess we'll find out! - z -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/