[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#8200: closed (cp -lr uses a lot of CPU time. )

From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8200: closed (cp -lr uses a lot of CPU time. )
Date: Thu, 10 Mar 2011 17:40:03 +0000

Your message dated Thu, 10 Mar 2011 18:39:34 +0100
with message-id <address@hidden>
and subject line Re: bug#8200: cp -lr uses a lot of CPU time.
has caused the GNU bug report #8200,
regarding cp -lr uses a lot of CPU time. 
to be marked as done.

(If you believe you have received this mail in error, please contact

8200: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8200
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: cp -lr uses a lot of CPU time. Date: Tue, 8 Mar 2011 06:08:40 +0100 User-agent: Mutt/1.5.13 (2006-08-11)

In my backupscripts I need a "cp -lr" every day. I make backups of
directories that hold up to millions of files. 


        cp -lr sourc dest

runs for a while, it becomes CPU limited. Virtual memory is only about
2Mb. "resident" is under 1M.

Top reports: 

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
26721 root      20   0  2456  720  468 R 58.0  0.1  65:32.60 cp
 2855 root      20   0  2560  936  624 R 40.8  0.1  30:30.52 cp

and I doubt they are half way through.

I wrote an application I call "cplr" which does the obvious in the
obvious manner, and it doesn't have this problem. 

I've run "strace", and determined that it is not doing systemcalls
that take much CPU time. Most system calls return in microseconds.

The time spent /between/ system calls runs up into the hundreds of
milliseconds. You might say: well that's way less than a
second. Sure. But if you need to do that tens of thousands of times it
becomes quite significant....

So my question is: Why does cp -lr take such rediculous amounts of CPU

Or another way: BUG REPORT: cp -lr takes unneccessary amounts of CPU


** address@hidden ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement. 
Does it sit on the couch all day? Is it unemployed? Please be specific! 
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ

--- End Message ---
--- Begin Message --- Subject: Re: bug#8200: cp -lr uses a lot of CPU time. Date: Thu, 10 Mar 2011 18:39:34 +0100
Rogier Wolff wrote:
> Aaargh... It seems the bug has been fixed... Feel free to ignore my
> explanation below.

Thanks.  I've marked this ticket as closed.

> On Tue, Mar 08, 2011 at 04:05:04PM +0100, Jim Meyering wrote:
>> For starters, what version of cp did you use?
>> Run cp --version
> -> cp (GNU coreutils) 8.5

In v7.0-63-g3ece035, I made this change:

    cp: use far less memory in some cases

    cp --link was "remembering" many name,dev,inode triples unnecessarily.

which would make a big difference in your case.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]