Browse Prior Art Database

Method for Causing a Certain Amount of CPU Usage in Preemptive Multitasking OSes

IP.com Disclosure Number: IPCOM000020376D
Original Publication Date: 2003-Nov-18
Included in the Prior Art Database: 2003-Nov-18
Document File: 1 page(s) / 46K

Publishing Venue

IBM

Abstract

Method for Causing a Certain Amount of CPU Usage in Preemptive Multitasking OSes

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 57% of the total text.

Page 1 of 1

Method for Causing a Certain Amount of CPU Usage in Preemptive Multitasking OSes

  CPUs are either performing operations or idle. By going between two routines, one routine which does work (and takes some time) and the second routine which causes the CPU to go idle via a sleep command (also for some time), a certain CPU load can be generated. The "length" of these operations needs to be gauged by high resolution timers/counters in order to get the desired CPU usage.

  Both the amount of time that the work takes, and the amount of time that the sleep command "takes", need to be recorded by high resolution timers / counters routines placed around the sleep and the work routines.

    This routine assumes that the CPU is not running anything which would interfere with these calculations.

    1. A starting value for the amount of work to do and the amount of time to sleep need to be chosen.

    2. Data about how long the work and how long the sleep takes needs to be gathered by running the work/sleep sequence several times. These numbers can be processed accordingly to get rid of bad sample data. (Drop samples which are far below the average, etc.) The goal is to get good numbers for how long the work and the sleep take.

    3. The "current" CPU usage rate is calculated by: Work Time / (Work Time + Sleep Time).

    4. This current CPU usage is compared to the desired CPU usage. If they are close enough, the process continues to step 5. If they are not, a factor is calculated to change the am...