https://bugs.kde.org/show_bug.cgi?id=377067

            Bug ID: 377067
           Summary: Excessive fdatasync in KConfig::sync
           Product: frameworks-kconfig
           Version: 5.31.0
          Platform: Archlinux Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: matt...@mjdsystems.ca
          Reporter: pbs3...@googlemail.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

Overview:

When any KDE 5 app starts, there is a short delay and an audible burst of disk
thrashing. This is a regression from KDE 4 where applications started up
instantly and with no disk thrashing.

Taking kwrite as an example, for each new instance started there is a delay of
~ 0.5s and a disk access. For each instance closed, there is also a shorter
disk access. This happens even though my fstab contains "commit=300",
indicating I wish to keep the last 5 minutes of data volatile in return for
better performance.

Observed behaviour:

>From strace, it turns out kwrite is calling fdatasync on the following files,
for every instance started:

  ~/.config/kwriterc.lock
  ~/.config/kwriterc.XM{#1}
  ~/.config/session/kwrite_{#2}.lock
  ~/.config/session/kwrite_{#2}.nS{#1}

>From gdb, the chain of events is:

  KConfig::sync -> QLockFile::tryLock / QSaveFile::commit -> fdatasync

Using a tmpfs home directory makes the disk thrashing go away, but not the
startup delay.

Conclusion:

KConfig performs aggressive syncing of config files, causing all KDE 5 apps to
have excessive HDD usage. (The startup delay is an unrelated problem that is
worth investigating, but I haven't found what it is yet.) Calling fdatasync all
the time overrides whatever data consistency guarantees the user may actually
want. In any case, forcing a disk sync on startup and exit of every single
application is certainly excessive. This is not to mention that starting a
program doesn't even produce any new data that is essential to sync
immediately.

I am not sure whether this behaviour is intentional, or the devs just haven't
noticed it due to having quieter disks - hence why this bug report exists.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to