psci-performance-methodology.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Runtime Instrumentation Methodology
  2. ===================================
  3. This document outlines steps for undertaking performance measurements of key
  4. operations in the Trusted Firmware-A Power State Coordination Interface (PSCI)
  5. implementation, using the in-built Performance Measurement Framework (PMF) and
  6. runtime instrumentation timestamps.
  7. Framework
  8. ~~~~~~~~~
  9. The tests are based on the ``runtime-instrumentation`` test suite provided by
  10. the Trusted Firmware Test Framework (TFTF). The release build of this framework
  11. was used because the results in the debug build became skewed; the console
  12. output prevented some of the tests from executing in parallel.
  13. The tests consist of both parallel and sequential tests, which are broadly
  14. described as follows:
  15. - **Parallel Tests** This type of test powers on all the non-lead CPUs and
  16. brings them and the lead CPU to a common synchronization point. The lead CPU
  17. then initiates the test on all CPUs in parallel.
  18. - **Sequential Tests** This type of test powers on each non-lead CPU in
  19. sequence. The lead CPU initiates the test on a non-lead CPU then waits for the
  20. test to complete before proceeding to the next non-lead CPU. The lead CPU then
  21. executes the test on itself.
  22. Note there is very little variance observed in the values given (~1us), although
  23. the values for each CPU are sometimes interchanged, depending on the order in
  24. which locks are acquired. Also, there is very little variance observed between
  25. executing the tests sequentially in a single boot or rebooting between tests.
  26. Given that runtime instrumentation using PMF is invasive, there is a small
  27. (unquantified) overhead on the results. PMF uses the generic counter for
  28. timestamps, which runs at 50MHz on Juno.
  29. Metrics
  30. ~~~~~~~
  31. .. glossary::
  32. Powerdown Latency
  33. Time taken from entering the TF PSCI implementation to the point the hardware
  34. enters the low power state (WFI). Referring to the TF runtime instrumentation points, this
  35. corresponds to: ``(RT_INSTR_ENTER_HW_LOW_PWR - RT_INSTR_ENTER_PSCI)``.
  36. Wakeup Latency
  37. Time taken from the point the hardware exits the low power state to exiting
  38. the TF PSCI implementation. This corresponds to: ``(RT_INSTR_EXIT_PSCI -
  39. RT_INSTR_EXIT_HW_LOW_PWR)``.
  40. Cache Flush Latency
  41. Time taken to flush the caches during powerdown. This corresponds to:
  42. ``(RT_INSTR_EXIT_CFLUSH - RT_INSTR_ENTER_CFLUSH)``.