Hi, i am currently overhauling getCPULoad and friends: - getCPULoad - getCPULoadConsiderNice - getCPULoadSMP
IMO, all but the last can go. UP is just a special case of SMP for us so why have the code duplicated? getCPULoad is only there for compatibility and there is not one single known user of it, so i'd drop it. getCPULoadConsiderNice is also only used by powersaved and i have already converted my "bleeding edge"-tree to use getCPULoadSMP always and it works better than before, since the old code was just plain wrong and evaluated the CPU load much more often than necessary. To lower the overhead and improve performance, i would call the getCPULoadSMP() with cpu number -1 to update the "load array" for all CPUs, if getCPULoadSMP() is called with a positive number, it just returns the pre-calculated cpu load for that particular processor. This also saves us from opening, parsing and closing /proc/stat 8 times on a 8-way machine (yes, right now it is done like that :-). An additional benefit would be that this will integrate nicely with the glib-mainloop since we can set an independent timer for the update of the CPU load, which will actually let the throttling code work correctly again, even with ondemand. Long story short: if nobody has some violent complaints, i'll add this to the unstable HEAD branch. I can also send a patch to review if someone really wants to look at it first. Thanks -- Stefan Seyfried \ "I didn't want to write for pay. I QA / R&D Team Mobile Devices \ wanted to be paid for what I write." SUSE LINUX Products GmbH, Nürnberg \ -- Leonard Cohen _______________________________________________ powersave-devel mailing list [email protected] http://forge.novell.com/mailman/listinfo/powersave-devel
