This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1306524 - Slow login due to calling lspci
Slow login due to calling lspci
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kde-settings (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-11 02:45 EST by Vojtech Juranek
Modified: 2016-04-15 03:21 EDT (History)
11 users (show)

See Also:
Fixed In Version: kde-settings-23-11.fc23.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-15 03:21:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vojtech Juranek 2016-02-11 02:45:54 EST
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 05:53:03 EST
*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 06:04:45 EST
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 06:19:16 EST
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 17:35:14 EST
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 12:35:54 EDT
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 12:50:45 EDT
@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 12:52:55 EDT
I suppose we could also consider moving this to /etc/X11/xinit/xinitrc.d
Comment 8 Fedora Update System 2016-03-25 10:15:42 EDT
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 11:19:22 EDT
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 03:21:10 EDT
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.