You are not logged in.

#1 2009-11-18 15:58:37

dcrabs
Member
From: Sweden
Registered: 2008-10-03
Posts: 149

Copying from SD card or USB slows computer down

Hi
Can someone tell my why copying from and internal SD card reader or usb makes my notebook unusable? Everything becomes slow, when I try to use dolphin to copy the files the computer starts swapping. Copying in the shell works but slows everything down.
It is really annoying and I thought it has been solved in last couple of years. Any ideas what I can tune?
dcrabs

Here is the output from top:

top - 16:49:52 up 2 days,  7:51,  2 users,  load average: 3.75, 2.92, 1.47
Tasks: 161 total,   5 running, 156 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.2%us,  6.8%sy,  0.0%ni, 18.1%id, 22.6%wa, 49.3%hi,  0.0%si,  0.0%st
Mem:   3890324k total,  3855172k used,    35152k free,    67160k buffers
Swap:  2506100k total,    94408k used,  2411692k free,  2499964k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
21403 davkra    20   0 2603m  30m 9788 R   19  0.8   4:55.66 Spotify
10847 root      20   0  814m 427m  59m S   15 11.2  96:36.36 X
10977 davkra    20   0  264m  34m  18m S    9  0.9  27:29.99 kwin
   22 root      15  -5     0    0    0 S    5  0.0   0:09.11 kswapd0
 1219 root      15  -5     0    0    0 S    4  0.0   0:10.48 kjournald2
20439 davkra    20   0  147m  41m  13m S    3  1.1   2:26.72 operapluginwrap
 1025 root      15  -5     0    0    0 S    2  0.0   0:30.81 hd-audio0
10983 davkra    20   0  303m  60m  31m S    2  1.6  45:45.55 plasma-desktop
20364 davkra    20   0  277m 195m  19m R    2  5.1  29:22.24 opera
11067 davkra    20   0 88448  28m  14m S    2  0.8   0:22.69 yakuake
23176 davkra    20   0  5256  720  592 R    2  0.0   0:07.98 cp
 1590 root      20   0  3368 1028  932 S    1  0.0   0:30.59 hald-addon-inpu
 1604 root      20   0  3372 1008  924 S    0  0.0   0:19.40 hald-addon-stor
21330 davkra    20   0  5276 2752  652 R    0  0.1   0:18.64 wineserver

And here is iotop (it's not so much which makes it even more annoying):

Total DISK READ: 4.32 M/s | Total DISK WRITE: 7.55 M/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
23176 be/4 davkra      4.32 M/s    4.32 M/s  0.00 % 97.31 % cp -v IMG_0004.JPG IMG_0005.JPG IMG_0006.JPG IMG_0013.JPG IMG_0014.JPG IMG_0~82.THM MVI_0083.MOV MVI_0083.THM /home/davkra/Pictures/Cleanroom/Processing/
 1219 be/3 root        0.00 B/s  334.64 M/s  0.00 %  3.77 % [kjournald2]
 1536 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % console-kit-daemon
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % ini
    2 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 rt/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    4 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    5 rt/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [watchdog/0]
    6 rt/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/1]
    7 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/1]
    8 rt/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [watchdog/1]
    9 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/0]
   10 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/1]
   11 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [khelper]
   12 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [async/mgr]
   13 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kblockd/0]
   14 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kblockd/1]
   15 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kacpid]
   16 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kacpi_notify]
   17 be/3 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kacpi_hotplug]

Offline

#2 2009-11-18 18:33:47

apaige
Member
Registered: 2008-06-15
Posts: 96

Re: Copying from SD card or USB slows computer down

You have 4 gigs of RAM, drop the swap already…

Offline

#3 2009-11-18 19:48:39

dcrabs
Member
From: Sweden
Registered: 2008-10-03
Posts: 149

Re: Copying from SD card or USB slows computer down

apaige wrote:

You have 4 gigs of RAM, drop the swap already…

To gain what? Have the system completely freezing?

Offline

#4 2009-11-18 21:30:06

Mountainjew
Member
From: Ireland
Registered: 2008-08-24
Posts: 405

Re: Copying from SD card or USB slows computer down

This is a common problem lately, i found it to be since kernel 2.6.28. I tried the LTS .27 version and it's much better but still bogs down my system when copying big files. And it's slow too.

Check out this thread http://bbs.archlinux.org/viewtopic.php?id=76553

Offline

#5 2009-11-18 21:48:10

apaige
Member
Registered: 2008-06-15
Posts: 96

Re: Copying from SD card or USB slows computer down

dcrabs wrote:
apaige wrote:

You have 4 gigs of RAM, drop the swap already…

To gain what? Have the system completely freezing?

Quite the opposite. Just try it: swapoff -a -v, then copy the files.

Offline

#6 2009-11-20 14:11:33

dcrabs
Member
From: Sweden
Registered: 2008-10-03
Posts: 149

Re: Copying from SD card or USB slows computer down

Thanks for the answers. Switching off swap doesn't make copying faster btw. Tried without swap just to be sure.

Offline

#7 2009-11-20 19:31:55

apaige
Member
Registered: 2008-06-15
Posts: 96

Re: Copying from SD card or USB slows computer down

But does it still slow everything down?

Offline

#8 2009-11-20 20:48:48

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Copying from SD card or USB slows computer down

What SWAP has to do with slowing down the system while copying large files to a flash storage device?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#9 2009-11-28 10:10:41

dcrabs
Member
From: Sweden
Registered: 2008-10-03
Posts: 149

Re: Copying from SD card or USB slows computer down

apaige wrote:

But does it still slow everything down?

yes

Offline

#10 2010-01-28 18:29:28

panuh
Member
From: X :ɯoɹℲ
Registered: 2009-11-24
Posts: 144

Re: Copying from SD card or USB slows computer down

I hope no one gets angry for the revival... smile

I am having exactly the same problem and I really feel like I'm not going to figure it out by myself. Actually my CPU load will shoot up to more than 4 and so the CPU runs hot even when I copy (large) files also within a drive (internal, external).

I have tried a lot of google-searching as well as looking for other threads. Somewhere I stumbled upon a forum thread talking about DMA not being activated but that exceeded my knowledge (how to check, activate, etc.).
Unfortunately I cannot find that thread anymore but maybe this could be a clue for someone...

Also, there was something mentioned about excessive caching, but here I think this is not the case, since flush seems to work fine. However, after cp having seemingly ended, my USB-stick's LED will continue blinking for quite a while. Oh man... I got no clue XD

The 'swapoff -a -v' wouldn't work for me either btw.

Thanks for any clues in advance

Offline

#11 2017-02-22 21:12:58

MarSoft
Member
Registered: 2013-02-03
Posts: 9

Re: Copying from SD card or USB slows computer down

Sorry for "necro-posting", but this topic is one of the first ones in google's results.

Buped into this problem myself. It didn't gone even after I changed laptop (put my SSD from the old laptop to the new one). So I would suppose it is not hardware but strictly software problem.
The problem is that when I copy large file from SSD to external storage (like USB flash drive) or from one flash drive to another.

I found partial solution for the issue. Right now I am copying 16g file, and am still able to use Firefox - almost no slowdowns happen.
The solution is described here: you can lower some process' IO priority, and that helps.
Here is what I did:

systemd-run --scope -b BlockIOWeight=10 cp ~/large-file /media/myflash/

It asks you to enter password in order to manipulate cgroup properties, but then the file is copied as usual, i.e. cp command is started from the right user.

Offline

#12 2017-02-22 21:17:55

MarSoft
Member
Registered: 2013-02-03
Posts: 9

Re: Copying from SD card or USB slows computer down

Just noticed that (with default settings) SSD uses deadline IO scheduler while usb flash uses CFQ scheduler. Probably it is related to the problem somehow.

mars@bookone p48 /sys $ cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
mars@bookone p48 /sys $ cat /sys/block/sdc/queue/scheduler
noop deadline [cfq]

Last edited by MarSoft (2017-02-22 21:19:35)

Offline

#13 2017-02-23 22:32:34

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: Copying from SD card or USB slows computer down

Thanks for sharing. I'm going to go ahead and close this ancient topic now. If you still feel there is more to discuss, please open a new topic.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB