Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754940Ab0FAHsK (ORCPT ); Tue, 1 Jun 2010 03:48:10 -0400 Received: from 0122700014.0.fullrate.dk ([95.166.99.235]:55920 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754375Ab0FAHsI (ORCPT ); Tue, 1 Jun 2010 03:48:08 -0400 Date: Tue, 1 Jun 2010 09:48:05 +0200 From: Jens Axboe To: mtk.manpages@gmail.com Cc: OGAWA Hirofumi , Andrew Morton , Linus Torvalds , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch] pipe: add support for shrinking and growing pipes Message-ID: <20100601074805.GM1660@kernel.dk> References: <20100523174706.GP23411@kernel.dk> <87632e846m.fsf@devron.myhome.or.jp> <20100524070552.GR23411@kernel.dk> <20100524173551.GU23411@kernel.dk> <20100524175649.GV23411@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2469 Lines: 58 On Tue, May 25 2010, Michael Kerrisk wrote: > On Mon, May 24, 2010 at 7:56 PM, Jens Axboe wrote: > > On Mon, May 24 2010, Michael Kerrisk wrote: > >> On Mon, May 24, 2010 at 7:35 PM, Jens Axboe wrote: > >> > On Mon, May 24 2010, Michael Kerrisk wrote: > >> >> > Right, that looks like a thinko. > >> >> > > >> >> > I'll submit a patch changing it to bytes and the agreed API and fix this > >> >> > -Eerror. Thanks for your comments and suggestions! > >> >> > >> >> Thanks. And of course you are welcome. (Please CC linux-api@vger on > >> >> this patche (and all patches that change the API/ABI.) > >> > > >> > The first change is this: > >> > > >> > http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b > >> > > >> > and the one dealing with the pages vs bytes API is this: > >> > > >> > http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=b9598db3401282bb27b4aef77e3eee12015f7f29 > >> > > >> > Not tested yet, will do so before sending in of course. > >> > >> Eyeballing it quickly, these changes look right. > > > > Good, thanks. > > > >> Do you have some test programs you can make available? > > > > Actually I don't, I test it by modifying fio's splice engine to set/get > > the pipe size and test the resulting transfers. > > Two more questions: is the rationale for this feature written up > somewhere? I could not find it. Is it primarily intended for > splice/vmsplice/tee, with the effect for pipe(2) being a side effect? Yes it's primarily for splice, where the 64kb size can sometimes become a limiting factor because of the pipe mutex lock/unlocking. > Also, the minuimum size of the buffer is 2 pages. Why is it not 1? > (Notwithstanding Linus's assertion, a buffer size of 1 page did give > us POSIX compliance in kernels before 2.6.10.) I'll defer to Linus on that, I remember some emails on that part from way back when. As far as I can tell, POSIX wants atomic writes of "less than a page size", which would make more sense as "of a page size and less". And since it should not be a page size from either side on a uni-directional pipe, then 1 page seems enough for that guarantee at least. -- Jens Axboe -- 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/