sleep() call causing unnecessary wake ups

Bug #1002811 reported by Harald Sitter
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xsettings-kde (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
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]
Reproduce:
* 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

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

Revision history for this message
Harald Sitter (apachelogger) wrote :

Fixed for quantal in 0.12.3-0ubuntu3

Changed in xsettings-kde (Ubuntu):
status: New → Fix Released
Revision history for this message
Harald Sitter (apachelogger) wrote :

0.12.3-0ubuntu2.1 uploaded for precise-proposed

Revision history for this message
Harald Sitter (apachelogger) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote : Missing SRU information

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 http://wiki.ubuntu.com/StableReleaseUpdates#Procedure 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)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

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 https://wiki.ubuntu.com/Testing/EnableProposed 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
Revision history for this message
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)
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.