Unbiased, Accurated CPU Utilization Measurement for MP and UP Systems Independent of MP Scheduling Algorithms
Original Publication Date: 2000-Mar-01
Included in the Prior Art Database: 2003-Jun-19
Unbiased, Accurated CPU Utilization Measurement for MP and UP Systems Independent of MP Scheduling Algorithms Disclosed here is a method for acquiring accurate, high resolution CPU utilization information in a UP or MP environment based upon a "stop watch" model whereby a high resolution timer is read immediately after a CPU leaves its idle loop and immediately prior to re-entering the idle loop to effectively accurately measure the "busy" time. "Busy times" are accumulated per CPU and made available to user callable routines. Previous approaches to accurately measuring cpu utilization (with code in the idle loop for example) are destined to failure due to increasing amounts of code added to the loop (resulting from newer scheduling algorithms for example). Offloading utilization measurement code to the idle loop is a desirable goal as long as the idle loop pathlength is minimal; however, as the pathlength increases, more and more error is added to the cpu busy time accumulation counter. And the problem is exacerbated if the idle loop pathlength is variable (as is often the case in MP environments) due to random (or variable) error that is difficult to adjust out. Also, previous approaches require use of locking to access the cpu utilization data.