High CPU load during file copy

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

High CPU load during file copy

Postby zugunder » Aug 15th, '13, 22:05

Hi,

Could anyone confirm what I see on my machine?
During copy of any big file (300-700MB) via Dolphin or Krusader the both cores of CPU are 100% loaded. I can see it in Ksysguard and via CPU plasma applet. However, top does not show anything unusual - maybe 10-15% load.
It seems to happen during copying from any FS to any FS (I checked ext4->fat, ext4->ext4, ntfs->ext4). I have not tried a set of smaller files though.
Mageia 3 64bit, KDE.

Thank you.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby wintpe » Aug 15th, '13, 23:26

while we are waiting for comparisons it would be nice to know what
hardware you are copying from and to.

you might think its all the same, but specifics will help, as there could be issues with a
particular sata driver, quite a few chips from various era's have this issue.

also disks could have bad blocks try running badblocks across both your drives.

how big are they what spin speed, all relevant stuff.

lastly iotop might also sheds some light on it, but before you do that try the following.

dd if=/dev/zero of=/mountpoint/afileoneachdisk count=1000000000

this will tell you the transfer speed of each disk

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: High CPU load during file copy

Postby jiml8 » Aug 16th, '13, 00:27

I think that ksysguard does not accurately take into account processor wait states.

The processor will wait on I/O of course and if it doesn't have anything else to do, it will show as waiting. Ksysguard is considering this as the processor being active (as opposed to idle) and reports it as busy.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: High CPU load during file copy

Postby zugunder » Aug 16th, '13, 04:02

wintpe

Thank you for the reply.

I was not attentive enough, I noticed that top was actually giving rather high CPU readings during file copy too, but with some delay.
The most consuming processes are:

kswapd0 66%
X 35%
kwin 15%
kworker/ 1:2 12%

If I turn off job notifications in KDE tray, kswapd0 jumps to 80%, the second is kworker, X and kwin do not use any CPU at all.
As far as I understand, kswapd is a process managing memory buffers during file operations. So why does it consume that much? Why X and kwin are eating lots of CPU?

Transfer speed seems to be OK, at least judging from the timing of file transfer. I have only one HDD (it is a laptop) with installed Win 7 (NTFS) and Mageia 3 (ext4).
CPU load reaches 100% if I copy a file from NTFS to ext4 or within the same ext4 partition (from /home/user to /home/user/). I also observe the same 100% load if I copy a file from ext4 to a flash stick (4GB Kingston Traveler).
My HDD seems to be in a decent shape, at least the test made by GSmartContol tell me that (I attached a couple of images). I also checked it for bad blocks under Windows - negative as well. And no, I do not observe high CPU load or low transfer speeds in Windows at all.
The laptop is on Intel 4 Series chipset with built-in video:
Code: Select all
lspci
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)
00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 03)
00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
[b]00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03)[/b]
02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
03:00.0 Ethernet controller: Qualcomm Atheros AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0)
Attachments
disk1.png
disk1.png (71.26 KiB) Viewed 3452 times
disk2.png
disk2.png (159.3 KiB) Viewed 3452 times
Last edited by zugunder on Aug 16th, '13, 04:27, edited 2 times in total.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby zugunder » Aug 16th, '13, 04:07

jiml8 wrote:I think that ksysguard does not accurately take into account processor wait states.
The processor will wait on I/O of course and if it doesn't have anything else to do, it will show as waiting. Ksysguard is considering this as the processor being active (as opposed to idle) and reports it as busy.

Thank you for the comment. It makes sense, but it would not this mean that ksysguard and top take their raw readings from different sources?
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby jiml8 » Aug 16th, '13, 04:20

zugunder wrote:Thank you for the comment. It makes sense, but it would not this mean that ksysguard and top take their raw readings from different sources?


I am not sure of the answer to that, but my thought is that it need not mean that at all. If you look at top, it provides details about processor usage broken down into idle, i/o wait, userspace, and supervisor space usage where ksysguard only gives a line graph or a cpu% value. Thus, top is giving a more detailed breakdown while ksysguard is giving an aggregated value.

I would contend that the aggregated value should not include i/o waits as processor active time, but this is what ksysguard is doing, apparently.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: High CPU load during file copy

Postby zugunder » Aug 16th, '13, 04:32

jiml8

Thank you for explanations. Sorry, I actually found out that the discrepancy between ksysguard and top readings were not so dramatic (though it definitelly exists). I was not attentive enough. I corrected the second post and pyut there some numbers from top. But the question why file transfer requires so much CPU power is still open.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby zugunder » Aug 18th, '13, 01:56

UPD

I have no idea why it is happening, but the inconsistency between top and ksysguard (and an applet) are back - kswapd0 does not consume much.
I understand what jiml8 said about ksysguard peculiar way of calculation of CPU load, but one simple thing makes me doubt - how did it happen that no one (including developers, etc) has noticed such a big difference during very popular and simple operation like file transfer?
So, is there any other way to reliably establish the actual CPU load (except measuring real wattage of the box)?

I attached 2 representative images taken during copying a file from my HDD to a flash stick - top and iotop outputs.
Attachments
disk7_1.png
disk7_1.png (115.86 KiB) Viewed 3418 times
disk6_1.png
disk6_1.png (104.33 KiB) Viewed 3418 times
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby zugunder » Aug 19th, '13, 20:44

Hi,

Returning to my very first posting - can anyone confirm that high CPU load (as reported by Ksysguard or plasma applet) during big files copy? Or does it happen to me only?
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby doktor5000 » Aug 19th, '13, 21:05

High CPU load can generally be observed in the following cases:

Writing a large number of small files onto flash-based partitions (SD cards, usb flash drives)
Writing onto NTFS partition with either a high fill state or which are highly fragmented

BTW: Writing to NTFS partitions uses much more CPU ressources in general compared to native unix filesystems like ext4.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: High CPU load during file copy

Postby zugunder » Aug 20th, '13, 01:15

doktor5000 wrote:High CPU load can generally be observed in the following cases:

Writing a large number of small files onto flash-based partitions (SD cards, usb flash drives)
Writing onto NTFS partition with either a high fill state or which are highly fragmented

BTW: Writing to NTFS partitions uses much more CPU ressources in general compared to native unix filesystems like ext4.


Well, all from above applies to my case AND copying a single 300-500MB file between the folders within my home directory on an ext4 partition. I am interested in confirmation of the latter.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: High CPU load during file copy

Postby eor2004 » Aug 21st, '13, 03:48

Hi everybody, I can confirm this behavior not only in Mageia but in PCLinuxOS too when using KDE DE, so I think Mageia is not the problem but KDE itself, for any info on my hardware specs, see my signature!

P.S. By the way my 250gb and my 500gb external hard disks that I use as backup use XFS Filesystem too!
Mageia 3 64-bit KDE
Gigabyte G41M-ES2L--> 3GB Ram
Intel Pentium Dual Core 2.60Ghz
Western Digital 500GB HDD--> XFS Filesystem
eor2004
 
Posts: 32
Joined: Jun 16th, '11, 20:10
Location: Puerto Rico

Re: High CPU load during file copy

Postby eor2004 » Aug 26th, '13, 05:02

I made a bug report about this issue, here's the link: https://bugs.mageia.org/show_bug.cgi?id=11077
Mageia 3 64-bit KDE
Gigabyte G41M-ES2L--> 3GB Ram
Intel Pentium Dual Core 2.60Ghz
Western Digital 500GB HDD--> XFS Filesystem
eor2004
 
Posts: 32
Joined: Jun 16th, '11, 20:10
Location: Puerto Rico


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest