Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859AbWKKK5k (ORCPT ); Sat, 11 Nov 2006 05:57:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753187AbWKKK5k (ORCPT ); Sat, 11 Nov 2006 05:57:40 -0500 Received: from emailer.gwdg.de ([134.76.10.24]:50922 "EHLO emailer.gwdg.de") by vger.kernel.org with ESMTP id S1751859AbWKKK5j (ORCPT ); Sat, 11 Nov 2006 05:57:39 -0500 Date: Sat, 11 Nov 2006 11:55:53 +0100 (MET) From: Jan Engelhardt To: Andrew Morton cc: "Igor A. Valcov" , linux-kernel@vger.kernel.org, xfs@oss.sgi.com Subject: Re: XFS filesystem performance drop in kernels 2.6.16+ In-Reply-To: <20061110225257.63f91851.akpm@osdl.org> Message-ID: References: <4553F3C6.2030807@sandeen.net> <20061110225257.63f91851.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Report: Content analysis: 0.0 points, 6.0 required _SUMMARY_ Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 992 Lines: 31 >> for (i = 0; i < 262144; i++) { >> /* Write data to a big file */ >> write (nFiles [0], buf, __BYTES); >> >> /* Write data to small files */ >> for (f = 1; f < __FILES; f++) >> write (nFiles [f], &f, sizeof (f)); >> } > >This sits in a loop doing write(fd, buf, 4). This is wildly inefficient - >you'd get a 10x throughput benefit and maybe 100x reduction in CPU cost >simply by switching to fwrite(). Well yes and no. The problem here is the syscall overhead. fwrite buffers things, so needless syscalls are avoided. The same could be done by changing the program logic and increasing the size argument to read/write. >I suspect something went wrong here. Design error. :) -`J' -- - 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/