( home )
 Last Modified:  15 May 2001
USER COST PER INTERRUPT,
Is It Constant?

The  user cost per interrupt  graph was determined in the range of 200 to 600 RTC+ units.  If the user cost per interrupt is constant over varying interrupt frequencies then we should be able to use the cost to predict the percent user data over all ranges in the  CPU overhead graph.

The "user cost per interrupt" data indicates a per interrupt cost of 9.2927 microseconds on average.  To graphically compare actual versus theoretical percent user times, the ordinate units will be percent user time with respect to total system time and the abscissa will represent periods between interrupts.  The unit of these periods will be based upon the experimentally determined user cost per interrupt.  For example, if interrupts occur every 5 such periods then the ordinate unit "5" corresponds to 5*9.2927 or about 46 microseconds between interrupts.   So the abscissa units are numbers of periods of user cost (experimentally determined) between interrupts; in the graph, this is called signal handling periods.  Note that 5 periods means that an interrupt occurs after every 5 periods and NOT at the end of a single period.

To calculate the theoretical percent user time, use 100 * (period - 1)/period.  In other words, the percent user time is based on the concept that the user gets the total periods between interrupts less then one that goes for handling the interrupt.

To calculate the abscissa values for the actual percent user times, use 100*(("RTC+" units) * (501 nanoseconds per RTC unit) + 9292.7)/9292.7;  this converts the RTC+ units from the CPU overhead graph to nanoseconds, which is then used with the average user cost  to estimate the abscissa values for actual percent user time.  Note:  the "501 nanoseconds per RTC unit"  was determined via testing .

The graph is below.  Based on the graph, the actual percent user time follows the theoretical percent user time fairly closely.  Therefore, the user cost per interrupt appears relatively constant over varyiing interrupt periods/frequencies.  This result also shows that the curve shown in the CPU overhead graph is as expected.



Bill Lawry