From owner-freebsd-hackers Fri Oct 26 8:30:55 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by hub.freebsd.org (Postfix) with ESMTP id 9CFE937B405 for ; Fri, 26 Oct 2001 08:29:55 -0700 (PDT) Received: from vega.vega.com (root@h33.228.dialup.iptcom.net [212.9.228.33]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id SAA69477; Fri, 26 Oct 2001 18:29:48 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id f9QFTkU29056; Fri, 26 Oct 2001 18:29:46 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3BD981EC.25F6DE24@FreeBSD.org> Date: Fri, 26 Oct 2001 18:31:56 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Peter Pentchev Cc: Ian Dowse , hackers@FreeBSD.org Subject: Re: cvs commit: ports/devel/ORBit Makefile ports/devel/ORBit/files patch-src::IIOP::giop-msg-buffer.c References: <200110261421.aa89321@salmon.maths.tcd.ie> <3BD977E4.DA2F224B@FreeBSD.org> <20011026175819.G33751@straylight.oblivion.bg> <3BD97C13.81DF3E6F@FreeBSD.org> <20011026181805.H33751@straylight.oblivion.bg> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Pentchev wrote: > > On Fri, Oct 26, 2001 at 06:06:59PM +0300, Maxim Sobolev wrote: > > Peter Pentchev wrote: > > > > > > On Fri, Oct 26, 2001 at 05:49:08PM +0300, Maxim Sobolev wrote: > [snip] > > > > > > > > On the step 3, when marshalling results of the call, daemon > > > > creates a large collection of small buffers (usually 5-10 > > > > bytes long each) arranged as array of struct iovec and then > > > > sends this whole buffer to the client using writev(2) call. > > > > In my particular case there were some 2,800 entries in the > > > > buffer and when the daemon tried to send it to the client > > > > writev(2) was returning -1 and setting errno to be EINVAL, > > > > which confused the server and the client causing RPC to > > > > fail. > > > > > > 2800 entries? Well, from the writev(2) manual page: > > > > > > In addition, writev() may return one of the following errors: > > > > > > ... > > > > > > [EINVAL] Iovcnt was less than or equal to 0, or greater than > > > UIO_MAXIOV. > > > > > > And at least on -stable, UIO_MAXIOV is defined as 1024.. > > > > Ah, ok. I've overlooked it somehow. > > So basically, you still want a loop, but it could be a writev(2) loop, > not a write(2) loop, to keep some of the writev(2) performance benefit. Yes, I've figured it already, because doing 2,800 syscalls when you can do a 3 instead is a bad idea. :) -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message