Bug 1306524 - Slow login due to calling lspci
Summary: Slow login due to calling lspci
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kde-settings
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-11 07:45 UTC by Vojtech Juranek
Modified: 2016-04-15 07:21 UTC (History)
11 users (show)

Fixed In Version: kde-settings-23-11.fc23.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-15 07:21:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vojtech Juranek 2016-02-11 07:45:54 UTC
Description of problem:
Recently, logins (via ssh or also su) became very slow, taking 10-15 sec. It turned out (credits to Radim Vansa), that it's caused by calling /etc/profile.d/qt-graphicssystem.sh script, which calls lspci every time, which is obviously slow. It's a workaround for BZ #810161 and it's seem to be there for very long time. However, we started to observed such slow down recently, so not completely sure what exactly triggers this misbehavior. 

Version-Release number of selected component (if applicable):
kde-settings-23-8
observed also on FC22

How reproducible:
always

Steps to Reproduce:
1. run e.g. `su -`

Actual results:
it takes about 10-15 sec to switch user

Expected results:
user is switched immediately

Comment 1 Rex Dieter 2016-02-11 10:53:03 UTC
*obviously* slow?

$ time lspci >& /dev/null

real    0m0.025s
user    0m0.018s
sys     0m0.007s


That said, if it indeed is slow, perhaps we can come up with a way to cache the results so it doesn't have to run *every* time.

Comment 2 Vojtech Juranek 2016-02-11 11:04:45 UTC
well, "obviously" wasn't proper wording, sorry.

on my machine:

$time lspci >& /dev/null  

real    0m8.744s
user    0m0.005s
sys     0m0.734s

As I mention, this seems to be there for quite a long time, while I start observing such slow logins couple of weeks back, so it's probably regression in some other component which makes lspci being slow.

That being said, I still think this is not an ideal solution, calling it only once and caching result would be definitely better.

Comment 3 Vojtech Juranek 2016-02-11 11:19:16 UTC
just for completeness, according to strace lspci seems to get stuck when reading config of VGA/NVIDIA device:

open("/sys/bus/pci/devices/0000:01:00.0/config", O_RDONLY) = 3

Comment 4 clime 2016-03-05 22:35:14 UTC
I have got exactly the same issue. The problem is with fairly long access to /sys/bus/pci/devices/0000:01:00.0/config (where 0000:01:00.0 is NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1)). 

By the way, after the file is accessed, there is around 10secs period when the access to it is instant. Then it gets slow again.

(I suspect that the core problem might be kernel related so I have filled the following bug: https://bugzilla.kernel.org/show_bug.cgi?id=113791. Nevertheless, is that workaround still needed?)

Comment 5 Rex Dieter 2016-03-24 16:35:54 UTC
Unfortunately, I can't think of any way to cache this in a safe way.

I had considered using $XDG_RUNTIME_DIR, but it appears that location gets cleared when user sessions end.


WORKAROUND: try setting environment variable either globally or in your user shell (ie, bash .profile or whatever):

QT_GRAPHICSSYSTEM_CHECKED=1

that should short-circuit and skip the check

Comment 6 Vojtech Juranek 2016-03-24 16:50:45 UTC
@Rex Dieter: ok, thanks for your effort! If there isn't any safe way how to cache, feel free to close it. Thanks.

Comment 7 Rex Dieter 2016-03-24 16:52:55 UTC
I suppose we could also consider moving this to /etc/X11/xinit/xinitrc.d

Comment 8 Fedora Update System 2016-03-25 14:15:42 UTC
kde-settings-23-11.fc23.1 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d8dbbc4b73

Comment 9 Fedora Update System 2016-03-26 15:19:22 UTC
kde-settings-23-11.fc23.1 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d8dbbc4b73

Comment 10 Fedora Update System 2016-04-15 07:21:10 UTC
kde-settings-23-11.fc23.1 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.