From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761903AbZANJ6n (ORCPT ); Wed, 14 Jan 2009 04:58:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755956AbZANJ61 (ORCPT ); Wed, 14 Jan 2009 04:58:27 -0500 Received: from mail.SerNet.de ([193.175.80.2]:54738 "EHLO mail.SerNet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbZANJ60 (ORCPT ); Wed, 14 Jan 2009 04:58:26 -0500 Date: Wed, 14 Jan 2009 11:03:30 +0100 From: Volker Lendecke To: Eric Dumazet Cc: Andrew Morton , linux-kernel@vger.kernel.org, Steven French , Jens Axboe , netdev@vger.kernel.org Subject: Re: maximum buffer size for splice(2) tcp->pipe? Reply-To: Volker.Lendecke@SerNet.DE References: <20090113123702.ad29cd13.akpm@linux-foundation.org> <496D2078.9080302@cosmosbay.com> <496DACBE.3030701@cosmosbay.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="32u276st3Jlj2kUU" Content-Disposition: inline In-Reply-To: <496DACBE.3030701@cosmosbay.com> User-Agent: Mutt/1.5.13 (2006-08-11) Message-Id: Organization: SerNet GmbH, Goettingen, Germany Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --32u276st3Jlj2kUU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 14, 2009 at 10:13:34AM +0100, Eric Dumazet wrote: > for (;;) { > struct pollfd pfd; > pfd.fd = socket; > pfd.events = POLLIN; > if (poll(&pfd, 1, -1) != 1) > continue; > res = splice(socket, NULL, pipefds[1], NULL, 65536, SPLICE_F_MOVE|SPLICE_F_NONBLOCK); > if (res > 0) > nwritten = splice(pipefds[0], NULL, file_fd, NULL, res, SPLICE_F_MOVE|SPLICE_F_MORE); > } Doesn't this reduce performance again? I thought the whole point of splice() was to increase performance by avoiding memory copies. If I have to do a poll syscall for each call to splice, doesn't the context switch eat that performance advantage again? Or was splice designed only for multi-threaded applications (which at least Samba is not)? Volker --32u276st3Jlj2kUU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFJbbhxbsgDfmnSbrYRArUlAKCNJN/kZsH3qvIYr463z1dlJbuFnQCfQ8qv alcUmIhEtdEGjlJBBkzCQt0= =FrZY -----END PGP SIGNATURE----- --32u276st3Jlj2kUU--