Bug 522628

Summary: High CPU usage of gpk-update-viewer
Product: [Fedora] Fedora Reporter: Christoph Wickert <christoph.wickert>
Component: gnome-packagekitAssignee: Richard Hughes <richard>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: rhughes, richard
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-28 14:34:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot showing gpk-update-viewer and it's CPU usage none

Description Christoph Wickert 2009-09-10 21:08:41 UTC
Description of problem:
gpk-update-viewer causes a high CPU load while downloading packages

Version-Release number of selected component (if applicable):
gnome-packagekit-2.27.3-1.fc11.x86_64

How reproducible:
always

Steps to Reproduce:
1. have a larger queue of updates (21 updates, ~170 MB)
2. run gpk-update-viewer to update your system
  
Actual results:
Top shows a load of ~20% while on an Intel Core 2 T5500 @ 1.66GHz. This is pretty much for just downloading some packages and showing nice animations. If you have a large number of updates, the system becomes unresponsive for the whole time of the download.

Expected results:
Downloading packages should not cause any notable CPU usage.

Comment 1 Richard Hughes 2009-09-11 16:24:44 UTC
What process is causing the high CPU? I can't reproduce here.

Comment 2 Christoph Wickert 2009-09-11 16:28:16 UTC
As mentioned before: gpk-update-viwewer

Comment 3 Christoph Wickert 2009-09-12 23:14:16 UTC
Created attachment 360823 [details]
Screenshot showing gpk-update-viewer and it's CPU usage

Today the updates queue has 36 updates, which again caused a cpu usage of ~ 30%. I managed to get a screenshot with 34.8%. Seems to be related to the animations, because if the spinners are not in the part of the window that is shown, the load drops. Scrolling also increases the load dramatically.

Comment 4 Richard Hughes 2010-03-23 09:33:00 UTC
Is this still relevant for the latest packages in F12? Thanks.

Comment 5 Christoph Wickert 2010-03-24 02:43:32 UTC
Yes, unfortunately it is.

Comment 6 Richard Hughes 2010-03-26 09:31:40 UTC
Okay, I've tracked this one down, and randomly it's a PackageKit bug. PackageKit is supposed to send:

(start of transaction)
DOWNLOADING foo

FINISHED foo
INSTALLING bar

FINISHED bar
(end of transaction)

and GPK starts a spinner on the action, and stops it on the finished signal. To keep the spinners spinning, we setup a timer that finds the current row, gets the value, and increments it in a tree model.

For one update, this is a trivial amount of CPU. If you've got 50 pending updates, then you've got O(n^n) complexity (as it's only ever designed for 1 or two updates, not all of them) which really hurts the CPU.

The fix we just to correct a conditional in PkBackend, which causes the FINISHED signal to be sent at the correct time.

commit d996046f6e47ca46eab45778e13414d27fbda534
Author: Richard Hughes <richard>
Date:   Fri Mar 26 09:26:19 2010 +0000

    Ensure the Package(finished) signal is always sent during the transaction. Fixes rh#522628

I'll build a new PK on Monday, and then attach the build to this bug.

Comment 7 Christoph Wickert 2010-03-26 12:31:07 UTC
Thanks a lot.

One more thing I have noticed: The load increases massively when one is scrolling in the window. Therefor if there are lots of small updates or cleanups that get applied very fast, it drives the load up.

Comment 8 Bug Zapper 2010-04-28 10:16:47 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2010-06-28 14:34:44 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 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.

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