Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328Ab0FSFqK (ORCPT ); Sat, 19 Jun 2010 01:46:10 -0400 Received: from ey-out-2122.google.com ([74.125.78.27]:21067 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319Ab0FSFqH (ORCPT ); Sat, 19 Jun 2010 01:46:07 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=J/JmSlrp4771uPpy/e6BrzuOgDqHjHcyuXbSYQjDc6Oga9mtmf1MXyKG2672RIG8GH x/B+mWlKxMzptqwwHQGC1aPlPdeRR0dWFyAMqJP4x558+M8sJ92wOe5jdVL0IBEHtrvn CKq8PZSJnQ5ETE84UoWrElvajFVR6zDiJQ/hI= MIME-Version: 1.0 Reply-To: mtk.manpages@gmail.com In-Reply-To: <4C07A51E.6090604@fusionio.com> References: <20100524070552.GR23411@kernel.dk> <20100524173551.GU23411@kernel.dk> <20100524175649.GV23411@kernel.dk> <20100601074534.GL1660@kernel.dk> <20100603061039.GD3564@kernel.dk> <20100603070126.GJ3564@kernel.dk> <4C078610.6020901@fusionio.com> <4C078E2B.7090107@fusionio.com> <4C0793F6.4070107@fusionio.com> <4C07A51E.6090604@fusionio.com> From: Michael Kerrisk Date: Sat, 19 Jun 2010 07:45:45 +0200 Message-ID: Subject: Re: [patch] pipe: add support for shrinking and growing pipes To: Jens Axboe Cc: Miklos Szeredi , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2695 Lines: 56 Hello Jens, I've tested this F_SETPIPE_SZ code as it appears in 2.6.35-rc3, and things seem to work as advertised, if the text below is the correct advertisement. Could you please review the following man-pages text, and let me know if it's okay. fcntl.2: F_SETPIPE_SZ (long; since Linux 2.6.35) Change the capacity of the pipe referred to by fd to be at least arg bytes. An unprivileged process can adjust the pipe capacity to any value between the system page size and the limit defined in /proc/sys/fs/pipe-size-max (see proc(5)). Attempts to set the pipe capacity below the page size are silently rounded up to the page size. Attempts by an unprivileged pro- cess to set the pipe capacity above the limit in /proc/sys/fs/pipe-size-max yield the error EPERM; a privileged process (CAP_SYS_RESOURCE) can override the limit. When allocating the buffer for the pipe, the kernel may use a capac- ity larger than arg, if that is convenient for the implementation. The F_GETPIPE_SZ operation returns the actual size used. Attempting to set the pipe capacity smaller than the amount of buffer space currently used to store data pro- duces the error EBUSY. F_GETPIPE_SZ (void; since Linux 2.6.35) Return (as the function result) the capacity of the pipe referred to by fd. And in proc.5: /proc/sys/fs/pipe-max-size (since Linux 2.6.35) The value in this file defines an upper limit for raising the capacity of a pipe using the fcntl(2) F_SETPIPE_SZ operation. This limit applies only to unprivileged processes. The default value for this file is 1,048,576. The value assigned to this file may be rounded upward, to reflect the value actually employed for a convenient implementation. To determine the rounded-up value, display the contents of this file after assigning a value to it. The minimum value that can be assigned to this file is the system page size. Cheers, Michael -- 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/