Bug 391738 - Dolphin needlesly scans /sys for no good reason
Summary: Dolphin needlesly scans /sys for no good reason
Status: RESOLVED FIXED
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.44.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 392469 (view as bug list)
Depends on:
Blocks: 391680
  Show dependency treegraph
 
Reported: 2018-03-12 01:07 UTC by Zakhar
Modified: 2019-09-04 21:46 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.45.0


Attachments
strace -f -T -tt -o log.txt dolphin (409.83 KB, application/zip)
2018-03-12 01:07 UTC, Zakhar
Details
strace -f -T -tt -o log.txt dolphin (this is new log) (3.59 MB, text/plain)
2018-04-15 00:14 UTC, Zakhar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zakhar 2018-03-12 01:07:37 UTC
Created attachment 111334 [details]
strace -f -T -tt -o log.txt dolphin

It takes it a while to start up, ran:

strace -f -T -tt -o log.txt dolphin

output is log.txt which is attached.
Comment 1 Michael Pyne 2018-03-12 23:59:59 UTC
There may be something here.  If you just grep for /sys/ in the uncompressed log and remove the rest of the strace output you get 10k lines of syscalls:

 $ kde@midna ~ $ grep '\/sys\/' log.txt | cut -f 3- -d ' ' | wc -l
10896

If you replace the file names in quotes with a token file name and then remove duplicates, there are only 18 types of syscalls made (and even these could be further condensed with a bit more inspection):

 $ kde@midna ~ $ grep '\/sys\/' log.txt | cut -f 3- -d ' ' | sed -e 's,) =.*$,),g' -e 's,"[^"]*",file,g' | sort | uniq | wc -l
18

These syscalls appear to be a sequence of syscalls involving a given file under /dev, e.g.

/sys/devices/pci0000:00/0000:00:18.0
/sys/devices/pci0000:00/0000:00:18.0/ID_MEDIA_PLAYER
/sys/devices/pci0000:00/0000:00:18.0/subsystem
/sys/devices/pci0000:00/0000:00:18.0/uevent

I'm not sure what code is responsible for these calls though, or even if it's KDE-related at all, which would be important in troubleshooting further.  It could as well be in UDisks or some other distro-provided library, the strace output is not limited to KDE-based code.
Comment 2 Kai Uwe Broulik 2018-03-13 16:00:54 UTC
Git commit 3b642556c2039fac6443c4b956c66ff176f65f15 by Kai Uwe Broulik.
Committed on 13/03/2018 at 16:00.
Pushed by broulik into branch 'master'.

[UDevManager] Already filter for subsystem before querying

This does some rough filtering in advance before creating our wrapper items with properties and all.
UDev default 70-uaccess.rules assumes, ID_MEDIA_PLAYER is always in "usb" subsystem

Differential Revision: https://phabricator.kde.org/D11290

M  +1    -1    src/solid/devices/backends/udev/udevdevice.cpp
M  +24   -10   src/solid/devices/backends/udev/udevmanager.cpp

https://commits.kde.org/solid/3b642556c2039fac6443c4b956c66ff176f65f15
Comment 3 Michael Pyne 2018-03-15 01:13:36 UTC
Closing bug as this commit should resolve the issue.  If it does not (keeping in mind the fix is first released in KF5 5.45!), please reopen.
Comment 4 Zakhar 2018-03-28 23:47:46 UTC
(In reply to Michael Pyne from comment #3)
> Closing bug as this commit should resolve the issue.  If it does not
> (keeping in mind the fix is first released in KF5 5.45!), please reopen.

Mind telling me when dolphin revision built with this patchset be released?
Comment 5 Michael Pyne 2018-03-29 00:34:05 UTC
(In reply to Zakhar from comment #4)
> (In reply to Michael Pyne from comment #3)
> > Closing bug as this commit should resolve the issue.  If it does not
> > (keeping in mind the fix is first released in KF5 5.45!), please reopen.
> 
> Mind telling me when dolphin revision built with this patchset be released?

Dolphin is not built directly against KF5::Solid, which is where the bug is present.  Today's version of Dolphin would be fixed with a corrected Solid library.

Solid will be released with the rest of the KDE Frameworks in early April 2018 with version 5.45.

The corresponding KDE Applications release will be 18.04, also in April (but after Frameworks 5.45).  Any distribution releasing Dolphin 18.04 should also be shipping Frameworks 5.45 with the fix.
Comment 6 Nate Graham 2018-03-30 15:23:09 UTC
*** Bug 392469 has been marked as a duplicate of this bug. ***
Comment 7 Zakhar 2018-04-15 00:14:22 UTC
Created attachment 112032 [details]
strace -f -T -tt -o log.txt dolphin (this is new log)

Reopening because
-Dolphis still starts slowly
-More than 500 /sys scans

patch improved situation but dolphin still starts slowly on an ssd