[RTEMS Project] #3253: Fix execution time in time partitioning environments

RTEMS trac trac at rtems.org
Thu Nov 23 06:16:22 UTC 2017


#3253: Fix execution time in time partitioning environments
-----------------------------+-----------------------------
 Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
     Type:  defect           |     Status:  assigned
 Priority:  normal           |  Milestone:  Indefinite
Component:  score            |    Version:
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 Currently, the uptime is used to measure execution times in RTEMS. This
 could be wrong in time partitioning environments, e.g. the RTEMS
 application is a hypervisor guest.  Here the guest execution may take
 place in time slots. The _TOD_Get_uptime() is currently used for the rate-
 monotonic statistics and thread CPU time used.  For example:

 {{{
 RTEMS_INLINE_ROUTINE void _Thread_Update_CPU_time_used(
   Thread_Control  *the_thread,
   Per_CPU_Control *cpu
 )
 {
   Timestamp_Control last;
   Timestamp_Control ran;

   last = cpu->cpu_usage_timestamp;
   _TOD_Get_uptime( &cpu->cpu_usage_timestamp );
   _Timestamp_Subtract( &last, &cpu->cpu_usage_timestamp, &ran );
   _Timestamp_Add_to( &the_thread->cpu_time_used, &ran );
 }
 }}}

 One approach to fix this problem would be some notification through a high
 priority guest interrupt by the hypervisor during time slot begin.
 However, _Thread_Update_CPU_time_used() is called with guest interrupts
 disabled.

 Another approach would be to introduce a _TOD_Get_system_execution_time()
 and define this to _TOD_Get_uptime() if RTEMS_PARAVIRT is not defined,
 otherwise add a new CPU port function _CPU_Get_system_execution_time()
 which must be provided by the hypervisor guest support.

 The difference between system execution time and uptime could be displayed
 in system diagnostic utilities, e.g. rtems_cpu_usage_report_with_plugin().

--
Ticket URL: <http://devel.rtems.org/ticket/3253>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list