From owner-cvs-all@FreeBSD.ORG Tue Mar 18 05:43:04 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD33A106564A; Tue, 18 Mar 2008 05:43:04 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-out-04.forthnet.gr (mx-out.forthnet.gr [193.92.150.104]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2998FC1A; Tue, 18 Mar 2008 05:43:02 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-av-02.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-04.forthnet.gr (8.13.8/8.13.8) with ESMTP id m2I5h0Jv015314; Tue, 18 Mar 2008 07:43:00 +0200 Received: from MX-IN-04.forthnet.gr (mx-in-04.forthnet.gr [193.92.150.163]) by mx-av-02.forthnet.gr (8.14.1/8.14.1) with ESMTP id m2I5h0Ul002697; Tue, 18 Mar 2008 07:43:00 +0200 Received: from [192.168.136.22] (adsl67-242.kln.forthnet.gr [77.49.114.242]) by MX-IN-04.forthnet.gr (8.14.2/8.14.2) with ESMTP id m2I5goeo027905; Tue, 18 Mar 2008 07:42:52 +0200 Authentication-Results: MX-IN-04.forthnet.gr smtp.mail=dds@aueb.gr; spf=neutral Authentication-Results: MX-IN-04.forthnet.gr header.from=dds@aueb.gr; sender-id=neutral Message-ID: <47DF5658.7060700@aueb.gr> Date: Tue, 18 Mar 2008 07:42:48 +0200 From: Diomidis Spinellis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070509 SeaMonkey/1.1.2 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200712180849.lBI8nmEi088947@repoman.freebsd.org> <20071218100355.GR16982@elvis.mu.org> <20080314223652.GA20470@garage.freebsd.pl> <47DE8D10.9090201@aueb.gr> <20080317235900.GA25950@garage.freebsd.pl> In-Reply-To: <20080317235900.GA25950@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, Alfred Perlstein , Diomidis Spinellis , src-committers@FreeBSD.org Subject: Re: cvs commit: src/tools/regression/bin/mv regress.sh X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2008 05:43:05 -0000 Pawel Jakub Dawidek wrote: > On Mon, Mar 17, 2008 at 05:24:00PM +0200, Diomidis Spinellis wrote: >> Pawel Jakub Dawidek wrote: >>> I was thinking about adding two options to cp(1) (-1 and -2) to give >>> cp(1) a hint if the copy is done inside one disk or between separate >>> disks. In -1 case cp(1) will read as large blocks as possible and then >>> write them, in -2 case it will spawn two threads: one reader and one >>> writer working in parallel. Performance improvements are very visible >> >from what I tested. >> Adding hints to cp(1) hinders portability. Even on the same OS, if two >> systems have their disks differently configured, a script may end up >> with an inappropriate hint on one of the two. Why not use fstat(2) to >> automatically determine if the file resides on different disks, and act >> accordingly? > > You can't say if this is the same disk or not. Think about more complex > situations like partitions on RAIDs, etc. (Or, even worse, volumes spanning multiple disks). What if cp(1) always worked in multithread mode for large files. Is that a pessimization for copies on the same disk? Don't disk accesses get appropriately reordered lower down? -- Diomidis Spinellis - http://www.spinellis.gr