Bug 1235681 - /usr/lib/polkit-1/polkitd consumes 20 to 30 % CPU constantly
Summary: /usr/lib/polkit-1/polkitd consumes 20 to 30 % CPU constantly
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rtkit
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-25 13:42 UTC by joshua
Modified: 2016-07-19 15:02 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1512942 (view as bug list)
Environment:
Last Closed: 2016-07-19 15:02:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description joshua 2015-06-25 13:42:57 UTC
Description of problem:

New install of Fedora 22 x86_64.  polkitd is using way too much CPU, all the time


Version-Release number of selected component (if applicable):

rpm -qf /usr/lib/polkit-1/polkitd
polkit-0.112-9.fc22.x86_64


How reproducible:

Install.  Boot.  Using the cinnamon desktop.

Comment 1 obihoernchende 2015-09-01 21:09:08 UTC
Same problem here.

This results in lags everywhere. While dragging windows, while typing, ...
Problem seems to be related to NetworkManager.

Try systemctl stop NetworkManager should fix this problem (ofc Internet will not work). Please try this. CPU usage should go away, too.

This happens with Cinnamon only!
Gnome works fine (other DEs, too I think).

Anybody any idea how to fix that?

Comment 2 joshua 2015-09-14 15:12:03 UTC
Yes, I find this only true with Cinnamon

Comment 3 Miloslav Trmač 2015-09-14 15:21:36 UTC
Thanks for your report. Could you try to track down the source of the activity?

Probably the easiest option is to follow https://wiki.ubuntu.com/DebuggingDBus (the system bus part) and look for the most frequent calls to org.freedesktop.PolicyKit1.Authority. )

Alternatively, as root run
> G_MESSAGES_DEBUG=all /usr/lib/polkit-1/polkitd --replac |& tee log
let it run for a while, then press Ctrl-C. Then search the resulting log file for the most frequent instances of
> … is inquiring whether … is authorized for …
(but this might change system behavior because the logging interferes with polkit-pkla-compat, undoing that would require additional steps)

Comment 4 joshua 2015-09-15 01:32:32 UTC
I run this for half an hour and see nothing but:

Successfully changed to user polkitd
20:51:17.594: Loading rules from directory /etc/polkit-1/rules.d
20:51:17.594: Loading rules from directory /usr/share/polkit-1/rules.d
20:51:17.595: Finished loading, compiling and executing 9 rules
Entering main event loop
Connected to the system bus
20:51:17.599: Acquired the name org.freedesktop.PolicyKit1 on the system bus


The whole time polkitd is very active and using between 5 and 15 % of CPU.

Comment 5 joshua 2015-09-15 01:32:45 UTC
I run this for half an hour and see nothing but:

Successfully changed to user polkitd
20:51:17.594: Loading rules from directory /etc/polkit-1/rules.d
20:51:17.594: Loading rules from directory /usr/share/polkit-1/rules.d
20:51:17.595: Finished loading, compiling and executing 9 rules
Entering main event loop
Connected to the system bus
20:51:17.599: Acquired the name org.freedesktop.PolicyKit1 on the system bus


The whole time polkitd is very active and using between 5 and 15 % of CPU.

Comment 6 Miloslav Trmač 2015-09-15 17:02:39 UTC
Sorry, the command is
> G_MESSAGES_DEBUG=all /usr/lib/polkit-1/polkitd --replace |& tee log
(--replace, not --replac); but the output you show suggest that you probably got it to work.

Still, no polkit requests at all? And the system otherwise works fine?!

I guess I will have to spin a VM… I’ll try an ordinary Workstation install + (dnf groupinstall); is there anything special I should know as a first^Wsecond-time Cinnamon user?

Comment 7 pb 2016-01-13 11:49:11 UTC
I have the same problem with MATE desktop
polkitd is constantly eating 20-50% CPU according "top"

My 10 minutes log:

G_MESSAGES_DEBUG=all /usr/lib/polkit-1/polkitd --replace >/var/tmp/log 2>&1 &
sleep 600 ; kill %1
awk '/is inquiring whether/||/is authorized for/{print$NF}' /var/tmp/log \
 |sort|uniq -c

  22968 org.freedesktop.RealtimeKit1.acquire-high-priority
  31320 org.freedesktop.RealtimeKit1.acquire-real-time

(nothing else)

Comment 8 Miloslav Trmač 2016-01-13 13:14:46 UTC
Thanks, the ~90 requests per second at a few ms per request can easily account for such a load.

So, next step is tracking what causes at least ~50 rtkit calls per second; looking at RPM dependencies. pulseaudio seems to be the only user, but reassigning to rtkit to be sure.

Comment 9 Fedora End Of Life 2016-07-19 15:02:34 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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