You are not logged in.

#1 2015-06-28 22:26:27

PBS
Member
Registered: 2015-06-28
Posts: 53

[SOLVED] KDE 5 kwrite disk thrashing on every keystroke

In KDE 5, typing in kwrite causes audible disk thrashing on every character added or deleted.
I turned on block dumping (/proc/sys/vm/block_dump = 1), and found that this was happening while holding a key down:

[173421.645231] kwrite(18959): WRITE block 126396656 on dm-0 (8 sectors)
[173421.645547] jbd2/dm-0-8(443): WRITE block 176623504 on dm-0 (8 sectors)
[173421.645555] jbd2/dm-0-8(443): WRITE block 176623512 on dm-0 (8 sectors)
[173421.645780] jbd2/dm-0-8(443): WRITE block 176623520 on dm-0 (8 sectors)
[173420.064876] kwrite(18959): WRITE block 126396656 on dm-0 (8 sectors)
[173420.065120] jbd2/dm-0-8(443): WRITE block 176623240 on dm-0 (8 sectors)
[173420.065129] jbd2/dm-0-8(443): WRITE block 176623248 on dm-0 (8 sectors)
[173420.065422] jbd2/dm-0-8(443): WRITE block 176623256 on dm-0 (8 sectors)

as well as less frequent occurrences of:

[173376.168662] kwrite(18959): dirtied inode 2100683 (.${filename}.kate-swp) on dm-0

(the ".kate-swp" files are for autorecovery, see this GSoC project)

The version of kwrite is 15.04.2-1. Meanwhile, the kde4 version 4.14.3-1 works perfectly.

My questions:
- Does this affect anyone else? (guess: no, since a search of the forums turns up nothing of relevance)
- Could this behaviour be the result of a misconfiguration or peculiarity of my setup, or a regression in katepart? (guess: the former, because I can't find any bug reports about it, and the problem dates back to at least January. Needless to say, I have not been using the broken version all that time!)
- How does one go about fixing it?

Last edited by PBS (2015-07-03 14:54:17)

Offline

#2 2015-06-29 17:32:49

Malkymder
Member
Registered: 2015-05-13
Posts: 258

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

might be unrelated but

cat /proc/sys/vm/block_dump

https://bbs.archlinux.org/viewtopic.php?id=112293

Last edited by Malkymder (2015-06-29 17:34:15)

Offline

#3 2015-06-29 18:52:31

rubenvb
Member
Registered: 2011-01-14
Posts: 104

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

I've noticed this too, although it happens sometimes. Also in Kate. Really irritating.

Offline

#4 2015-07-02 22:40:36

PBS
Member
Registered: 2015-06-28
Posts: 53

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

Malkymder wrote:

might be unrelated but

cat /proc/sys/vm/block_dump

https://bbs.archlinux.org/viewtopic.php?id=112293

Thanks, but that's not the problem; I had deliberately turned on /proc/sys/vm/block_dump to monitor katepart's disk accesses (and forunately remembered to turn it off again, unlike in https://bbs.archlinux.org/viewtopic.php?id=112293).

Offline

#5 2015-07-03 14:53:37

PBS
Member
Registered: 2015-06-28
Posts: 53

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

I tried the latest kwrite/kate again today (15.04.3-1), and the bug is still present.

After some experimenting,

  • Both kwrite and kate share katepart as their text editing component.

  • The problem does not appear until the document is first saved, which is also when katepart activates its swapfile.

  • When the swap file is disabled (in kwrite: Settings > Configure Editor > Open/Save > Advanced), the problem disappears.

The workaround is to disable swapfiles as above.

(in fact, I can't even see the point of them: they don't protect the most volatile documents of all - those than have not yet been saved, and as for protecting documents from a system crash, well my system doesn't crash - at least not since https://bbs.archlinux.org/viewtopic.php?id=167205 was fixed...)

Investigating a bit more,

  • The swapfile sync timeout defaults to 15 sec.

  • Setting it to the maximum value of 600 sec causes the disk thrashing noise to be delayed by about half a second...

The obvious conclusion is that since the port to Qt5, somehow the string "15 s" is getting interpreted in millseconds, causing the sync timeout to be 1000 times shorter than intended.

Offline

#6 2015-07-04 01:08:37

PBS
Member
Registered: 2015-06-28
Posts: 53

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

I've tracked it down to kateswapfile.cpp. In KDE 4, we have

syncTimer()->start(15000);

whereas in KDE 5

syncTimer()->start(m_document->config()->swapSyncInterval());

which should be

syncTimer()->start(m_document->config()->swapSyncInterval() * 1000);

Now if a passing kde dev could actually commit this...? please?

Offline

#7 2015-07-04 06:38:35

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,313

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

PBS wrote:

I've tracked it down to kateswapfile.cpp. In KDE 4, we have

syncTimer()->start(15000);

whereas in KDE 5

syncTimer()->start(m_document->config()->swapSyncInterval());

which should be

syncTimer()->start(m_document->config()->swapSyncInterval() * 1000);

Now if a passing kde dev could actually commit this...? please?

I don't think KDE devs go browsing every distribution's forum looking for bugs. Please report it at bugs.kde.org

Offline

#8 2015-07-04 13:10:45

PBS
Member
Registered: 2015-06-28
Posts: 53

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

I don't think KDE devs go browsing every distribution's forum looking for bugs.

It was worth a try.

Anyway, here's the bug I reported,
https://bugs.kde.org/show_bug.cgi?id=349893

Offline

#9 2015-07-14 22:32:40

PBS
Member
Registered: 2015-06-28
Posts: 53

Re: [SOLVED] KDE 5 kwrite disk thrashing on every keystroke

Seems to be fixed in 15.04.3-1.

Offline

Board footer

Powered by FluxBB