From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 8 08:48:31 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3C22106566C for ; Sat, 8 Mar 2008 08:48:31 +0000 (UTC) (envelope-from silby@silby.com) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 572068FC13 for ; Sat, 8 Mar 2008 08:48:31 +0000 (UTC) (envelope-from silby@silby.com) Received: (qmail 702 invoked from network); 8 Mar 2008 08:21:49 -0000 Received: from unknown (HELO localhost) (unknown) by unknown with SMTP; 8 Mar 2008 08:21:49 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sat, 8 Mar 2008 02:21:46 -0600 (CST) From: Mike Silbersack To: Antipov Dmitry In-Reply-To: <713411204954593@webmail21.yandex.ru> Message-ID: <20080308021506.L11630@odysseus.silby.com> References: <713411204954593@webmail21.yandex.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: [kern/sys_pipe.c] PIPE_NODIRECT and pipe throughput X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2008 08:48:31 -0000 On Sat, 8 Mar 2008, Antipov Dmitry wrote: > [originally posted to freebsd-stable@] > > Hello all, > > recently I've tried a few benchmarks around pipe throughput on Linux vs. FreeBSD. > Everyone interesting can see my stuff at http://213.148.29.37/PipeBench, and > initial post to Linux kernel developers mailing list at > http://www.uwsg.iu.edu/hypermail/linux/kernel/0803.0/1837.html > > 1) It was noticed (http://www.uwsg.iu.edu/hypermail/linux/kernel/0803.0/1842.html) that > the page flipping may be a reason of FreeBSD advantage. I've looked at kern/sys_pipe.c > and found that defining PIPE_NODIRECT should disable it. Is that correct ? Yes, that is correct. > 2) When I've tried to run the kernel (7.0-STABLE) with PIPE_NODIRECT defined, > I didn't see any slowdown (note 30% is promised in kern/sys_pipe.c comments) > even for I/O buffer sizes >= PIPE_MINDIRECT. So, what should be done with a pipe > to see a difference between PIPE_NODIRECT enabled and disabled ? > > Thanks, > Dmitry Why don't you add another sysctl that is incremented every time page flipping is used? That would prove how much it is being used during your tests. Just add: static int page_flips; SYSCTL_INT(_kern_ipc, OID_AUTO, page_flips, CTLFLAG_RD, &page_flips, 0, "Pipe page flips"); and then put page_flips++ at the appropriate points in the code. You should really use gnuplot or some other tool to graph your results. That will make them much easier to understand. -Mike