Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Low priority for hard disk copy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Fri Jul 10, 2009 6:18 pm    Post subject: Low priority for hard disk copy Reply with quote

When I copy some files from a partition to an other, or my hard drive to and external one, all my system is freezing. It works still, but it's very slow because the hard drive is working with the copy. It's really annoying when copying Gigabytes of data, when it takes half an hour or more, and during this time the system is hardly usable.
Is there any way to have a very low priority to file transfers, so that other programs can still work normally ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Fri Jul 10, 2009 6:24 pm    Post subject: Reply with quote

geenux,

There is no simple answer. It depends what the bottleneck is.
External USB drives cannot use DMA, so writing to USB drives is processor intensive.

You can try to renice your copy process, which may not help if 'dirty' buffers are your problem.
Thats areas of memory occupied by data read from disk and waiting to be written.

Maybe your hard drive could be faster. What does hdparm /dev/.... show for your internal drive?
If your drive is /dev/sd... everything is good and that command will probably fail
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Sat Jul 11, 2009 7:45 am    Post subject: Reply with quote

Code:
/dev/sda:
 multcount     = 16 (on)
 IO_support    =  0 (default)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 19457/255/63, sectors = 312581808, start = 0
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Sat Jul 11, 2009 4:58 pm    Post subject: Reply with quote

geenux,

Thats correct for /dev/sda, do you have a hard drive at /dev/hda too ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Sat Jul 11, 2009 6:07 pm    Post subject: Reply with quote

No, I've only one sata hard drive.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Sat Jul 11, 2009 7:17 pm    Post subject: Reply with quote

geenux,

During or after the errors, are there any SATA of drive related errors in dmesg ?

Please post the output of
Code:
grep PREE /usr/src/linux/.config
so we can check your kernel preemption settings.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Sun Jul 12, 2009 7:05 am    Post subject: Reply with quote

There is no sata errors in dmesg.
Code:
grep PREE /usr/src/linux/.config
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Sun Jul 12, 2009 6:03 pm    Post subject: Reply with quote

geenux,

You can rebuild your kernel to provide more agressive preemption than CONFIG_PREEMPT_VOLUNTARY=y
In the Preemption Model (Preemptible Kernel (Low-Latency Desktop)) ---> menu, choose
Code:
    │ │          ( ) No Forced Preemption (Server)                     │ │ 
    │ │          ( ) Voluntary Kernel Preemption (Desktop)             │ │ 
    │ │          (X) Preemptible Kernel (Low-Latency Desktop)   

This makes the kernel yield the CPU to user tasks more often. Overall, it slows things down as there is more task switching but the result is that your system is more responsive to user commands.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Sun Jul 12, 2009 6:08 pm    Post subject: Reply with quote

I'll try. But my guess is the problem is not coming from the CPU. It's Intel Dual Core 2.2Ghz. I guess the problem comes from disk reading during the copy, as when an application, such as firefox is still in cache, it launches quite rapidly (maybe 3 or 4 fours seconds more than usual), whereas when it is not in the cache, it takes about 20 seconds.
But maybe I'm wrong, i'll rebuild my kernel, according to your proposition.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Sun Jul 12, 2009 6:43 pm    Post subject: Reply with quote

geenux,

Disk latency is certainly a part of the problem as you have to wait while the drive moves the heads to find your program.
A copy from one partition to another involves a lot of head movements.

Reading/Writing to USB mass storage devices is CPU intensive as it cannot use DMA.
The CPU must move all the data.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
geenux
n00b
n00b


Joined: 15 Mar 2008
Posts: 40

PostPosted: Tue Jul 14, 2009 10:05 am    Post subject: Reply with quote

I rebuilt my kernel, and it seems to be exactly the same.
It shall be great if the copy process paused when an other action is required on the disk. So, when an application needs to be started, the copy would stop until it is started. Is it possible to do so ?
Back to top
View user's profile Send private message
Exil
Apprentice
Apprentice


Joined: 10 Oct 2005
Posts: 251
Location: Nibylandia

PostPosted: Tue Jul 14, 2009 12:29 pm    Post subject: Reply with quote

nice -n19 command
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Wed Jul 15, 2009 9:49 am    Post subject: Reply with quote

Shouldn't that be ionice ?! :wink:
Try scheduling clash 3 for "Beat Effort" or even "Idle".

Alternatively, you could try rsync instead of cp. Use the "--bwlimit" option.



Cheers,
Just
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum