sleep() call causing unnecessary wake ups

Bug #1002811 reported by Harald Sitter on 2012-05-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xsettings-kde (Ubuntu)
Michał Zając

Bug Description

In the xevent processing thread there is a conditional sleep() call when the event queue is empty. This is unnecessary as the used XNextEvent function blocks on an empty queue. The sleep call thus causes an unnecessary wake up every 2 seconds preventing CPU sleep and consuming CPU time for no good reason.

This is easily resolved by removing the bogus loop.

[Test Case]
* make sure xsettings-kde is running
* use sudo powertop
* observe that xsettings-kde is having 0.5 events/second (one event every 2 seconds) and causes CPU usage of (on my system) 14us

* in powertop xsettings-kde does not have any events most of the time, using no CPU (or it is not showing up at all)

Harald Sitter (apachelogger) wrote :

Fixed for quantal in 0.12.3-0ubuntu3

Changed in xsettings-kde (Ubuntu):
status: New → Fix Released
Harald Sitter (apachelogger) wrote :

0.12.3-0ubuntu2.1 uploaded for precise-proposed

Harald Sitter (apachelogger) wrote :

Thanks for uploading the fix for this bug report to -proposed. However, when reviewing the package in -proposed and the details of this bug report I noticed that the bug description is missing information required for the SRU process. You can find full details at but essentially this bug is missing some of the following: a statement of impact, information regarding the development fix, a test case and details regarding the regression potential. Thanks in advance!

Changed in xsettings-kde (Ubuntu Precise):
status: New → Triaged
Steve Langasek (vorlon) on 2012-05-24
description: updated

Hello Harald, or anyone else affected,

Accepted xsettings-kde into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See for documentation how to enable and use -proposed. Thank you in advance!

Changed in xsettings-kde (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Jonathan Thomas (echidnaman) wrote :

I can confirm that with the packages from precise-proposed, xsettings-kde drops out of powertop's display.

tags: added: verification-done
removed: verification-needed
Changed in xsettings-kde (Ubuntu Precise):
assignee: nobody → Michał Zając (quintasan)
GreyGeek (greygeek77) wrote :

My Kubuntu 12.04 system updated to xsetting-kde-0.12.3-0ubuntu2.1 a few hours ago. A reboot or restart of the xserver was requested. After a reboot the video display began blanking (black screen) every 2 or 3 seconds. I had to move the mouse to keep the display visible.

I opened a Konsole and issued:
xset dpms 0 0 0

and the blanking stopped. However, some video events (starting a youtube video or opening a PDF) restarts the blanking and the above command has to be repeated. Settings in the "Power Settings" option of the battery monitor have no effect.

Jonathan Thomas (echidnaman) wrote :

This update does not request a restart of the X server. You may be experiencing a regression caused by another package introduced to precise-proposed.

Jonathan Thomas (echidnaman) wrote :

What you are experiencing is bug 952521, unrelated to this change or xsettings-kde in general.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xsettings-kde - 0.12.3-0ubuntu2.1

xsettings-kde (0.12.3-0ubuntu2.1) precise-proposed; urgency=low

  * Add kubuntu_busy_wait.patch removing busy waiting for events, which is
    more elegantly hidden away in XNextEvent. This removes xsettings from
    powertop listing pretty much as it is now in fact only doing stuff when
    there is stuff to be done. (LP: #1002811)
 -- Harald Sitter <email address hidden> Tue, 22 May 2012 13:40:29 +0200

Changed in xsettings-kde (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers