[RTEMS Project] #2840: Use C11 mutexes for Termios framework

RTEMS trac trac at rtems.org
Wed Dec 14 12:53:36 UTC 2016


#2840: Use C11 mutexes for Termios framework
-----------------------------+-----------------------------
 Reporter:  sebastian.huber  |      Owner:  sebastian.huber
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  4.12
Component:  cpukit           |    Version:  4.11
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 Use C11 mutexes instead of Classic semaphores as a performance
 optimization and to simplify the application configuration.

 A performance of Classic semaphores vs. C11 mutexes was measured on the
 arm/atsam BSP. A NXP SC16IS752 was connected via SPI. The RTEMS
 application used one task to read from the device and write it immediately
 back (look back via task). A development system constantly transmitted
 data at 115200 bits per second.

 CPU usage by function with Classic semaphores:

 {{{
 name______________________________________|ratio___|1%_____2%________5%_____10%_____20%_______50%___100|
 CPU_Thread_Idle_body                      |
 22.454%|=================================                  |
 atsam_spi_setup_transfer                  |  6.767%|====================
 |
 Objects_Get                               |  5.859%|===================
 |
 atsam_spi_interrupt                       |  4.483%|================
 |
 Event_Seize                               |  3.867%|==============
 |
 rtems_termios_enqueue_raw_characters      |  3.804%|==============
 |
 Timecounter_Binuptime                     |  3.715%|==============
 |
 Scheduler_priority_Block                  |  3.104%|============
 |
 rtems_semaphore_release                   |  3.018%|============
 |
 Scheduler_priority_Unblock                |  2.901%|===========
 |
 rtems_termios_read_tty                    |  2.777%|===========
 |
 ARMV7M_NVIC_Interrupt_dispatch            |  2.750%|===========
 |
 rtems_semaphore_obtain                    |  2.627%|==========
 |
 Thread_Do_dispatch                        |  2.351%|=========
 |
 ARMV7M_Interrupt_service_leave            |  2.086%|========
 |
 iproc                                     |  1.919%|=======
 |
 CPU_Context_switch                        |
 }}}
 CPU usage by function with C11 mutexes:

 {{{
 name______________________________________|ratio___|1%_____2%________5%_____10%_____20%_______50%___100|
 CPU_Thread_Idle_body                      |
 33.395%|======================================             |
 atsam_spi_setup_transfer                  |  6.061%|===================
 |
 atsam_spi_interrupt                       |  4.690%|================
 |
 Mutex_recursive_Release                   |  3.011%|============
 |
 Event_Seize                               |  2.955%|===========
 |
 ARMV7M_NVIC_Interrupt_dispatch            |  2.885%|===========
 |
 rtems_termios_enqueue_raw_characters      |  2.771%|===========
 |
 rtems_termios_read_tty                    |  2.722%|===========
 |
 Timecounter_Binuptime                     |  2.653%|==========
 |
 Thread_Do_dispatch                        |  2.240%|========
 |
 Scheduler_priority_Block                  |  2.112%|========
 |
 ARMV7M_Interrupt_service_leave            |  2.100%|========
 |
 Scheduler_priority_Unblock                |  1.919%|=======
 |
 Mutex_recursive_Acquire                   |  1.876%|======
 |
 iproc                                     |  1.773%|======
 |
 CPU_Context_switch                        |
 }}}

 The change resulted in 10% more total idle time on the system.

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


More information about the bugs mailing list