[Pixman] [PATCH 05/14] ARMv6: Force fast paths to have fixed alignment to the BTAC

Ben Avison bavison at riscosopen.org
Tue Oct 1 16:00:25 PDT 2013


Trying to produce repeatable, trustworthy profiling results from the
cairo-perf-trace benchmark suite has proved tricky, especially when testing
changes that have only a marginal (< ~5%) effect upon the runtime as a whole.

One of the problems is that some traces appear to show statistically
significant changes even when the only fast path that has changed is not even
exercised by the trace in question. This patch helps to address this by
ensuring that the aliasing between the branch predictor's target address cache
(BTAC) for the remaining fast paths is not affected by the additional, removal
or refactoring of any other fast paths.

The profiling results later in this patch series have been calculated with
this switch enabled, to ensure fair comparisons. Additionally, the
cairo-perf-trace test harness itself was modified to do timing using
getrusage() so as to exclude any kernel mode components of the runtime.
Between these two measures, the majority of false positives appear to have
been eliminated; the remaining ones tend to fall below 2% change, so any
such measurements have been excluded from the reports.
---
 pixman/pixman-arm-simd-asm.S |    3 +++
 pixman/pixman-arm-simd-asm.h |    9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/pixman/pixman-arm-simd-asm.S b/pixman/pixman-arm-simd-asm.S
index c209688..259fb88 100644
--- a/pixman/pixman-arm-simd-asm.S
+++ b/pixman/pixman-arm-simd-asm.S
@@ -611,3 +611,6 @@ generate_composite_function \
 
 /******************************************************************************/
 
+#ifdef PROFILING
+.p2align 9
+#endif
diff --git a/pixman/pixman-arm-simd-asm.h b/pixman/pixman-arm-simd-asm.h
index 4c08b9e..c7e5ca7 100644
--- a/pixman/pixman-arm-simd-asm.h
+++ b/pixman/pixman-arm-simd-asm.h
@@ -54,6 +54,12 @@
  */
 
 /*
+ * Determine whether we space out fast paths to reduce the effect of
+ * different BTAC aliasing upon comparative profiling results
+ */
+#define PROFILING
+
+/*
  * Determine whether we put the arguments on the stack for debugging.
  */
 #undef DEBUG_PARAMS
@@ -590,6 +596,9 @@
                                    process_tail, \
                                    process_inner_loop
 
+#ifdef PROFILING
+ .p2align 9
+#endif
  .func fname
  .global fname
  /* For ELF format also set function visibility to hidden */
-- 
1.7.10.4



More information about the Pixman mailing list