• No results found

Profiling memory accesses on the ODROID-XU4

N/A
N/A
Protected

Academic year: 2021

Share "Profiling memory accesses on the ODROID-XU4 "

Copied!
22
0
0

Loading.... (view fulltext now)

Full text

(1)

IT 17074

Examensarbete 15 hp Oktober 2017

Profiling memory accesses on the ODROID-XU4

Erik Österberg

Institutionen för informationsteknologi

(2)

Teknisk- naturvetenskaplig fakultet UTH-enheten

Besöksadress:

Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0

Postadress:

Box 536 751 21 Uppsala

Telefon:

018 – 471 30 03

Telefax:

018 – 471 30 00

Hemsida:

http://www.teknat.uu.se/student

Abstract

Profiling memory accesses on the ODROID-XU4

Erik Österberg

Decoupled Access-Execute(DAE) is an innovative approach to optimize energy consumption of computer programs by splitting the program into two tasks; the first task is to access data, this is profoundly memory-bound and can be done with energy efficient cores. The second task is to execute and compute the data, which is compute-bound and can be done with powerful cores. This thesis work aims to develop a profiling tool that can measure the efficiency of DAE by investigating the cache misses in the original code and the DAE code (in the access and execute phases). This was achieved by measuring the cache loads and memory accesses for the DAE transformation for the benchmarks done by a previous study that targets DAE on Arm's HMP architecture, big.LITTLE. The data obtained from this study show that DAE on big.LITTLE has a potential for energy savings, especially with applications that feature indirection in memory accesses. Arm DynamIQ opens up new

possibilities for DAE code transformation. New levels of energy efficiency can be reached with a finer-grained Dynamic Voltage Frequency Scaling(DVFS), a more rapid power, state transition mechanism and a shared cache for 'big' and 'LITTLE' CPUs.

(3)

Contents

1 Introduction 1

2 Background 2

2.1 Decoupled Access-Execute . . . . 2

2.2 Arm big.LITTLE . . . . 3

2.3 Decoupled Access-Execute on Arm big.LITTLE . . . . 5

3 Related work 6 4 Methodology 7 4.1 Implementation of framework for collecting memory access events using Arm PMU . . . . 7

4.2 Enable user space access . . . . 7

4.3 Access PMU registers . . . . 8

4.4 Using performance counters . . . . 10

4.5 CCI-400 Cache Coherent Interconnect . . . . 11

5 Evaluation 12 5.1 Environmental setup . . . . 12

5.2 Benchmark description . . . . 12

5.3 Result . . . . 13

6 Conclusions and future work 17

7 References 18

(4)

1 Introduction

For the last half-century, computers have had an exponential increase in performance.

This phenomenal progress is often referred to as Moore’s law. This has created an expectation of continued progress at a similar rate. [1]

Big steps have been taken towards more mobile computing with the introduction of smart phones and other smart devices for instance, wearable devices. With these portable and smaller devices, scientists have to focus more on power-conserving tech- nologies.

The focus on the computational speed of the CPU[2] has resulted in long complex pipelines. This complex architecture utilizes more transistors and does not necessarily help to conserve power.

In the last decade, the company Advanced RISC Machine(Arm)1 has become suc- cessful with the shift to more mobile battery power computing systems. Arm uses a Reduced Instruction Set Computing (RISC) architecture. The RISC approach makes it possible to be implemented in a simple low-powered design, using fewer transistors.

Arm has traditionally had low power designs[3]. To increase the performance of CPUs more intricate designs of the RISC architecture were developed. This created faster but more power hungry cores.

The company identified a trend towards mobile devices that have a very high compu- tational demand in some situations, followed by low computational need, which made Arm create the Arm big.LITTLE architecture[4].

The big.Little architecture combines fast power hungry CPU with ultra energy effi- cient cores with lower computational capability on the same System on a chip(SoC).

Power consumption and compute performance for a Cortex-A15(big)[5] and a Cortex- A7(little)[6] is illustrated in Figure 1.

The computational speed of today’s CPUs is exceptional. This has put more pressure on memory speeds to be able to supply information quickly enough. This problem is solved with different types of fast cache. If the information is not in the cache a typical CPU stalls and this waiting waste energy without doing any computing.2 To reduce the stalling time there is a technique called Decoupled Access-Execute (DAE)[7]. DAE splits a program into two tasks; first task is to access data, this is heavily memory-bound and can be done with energy efficient cores. The second task is to execute and compute the data, which is compute-bound and can be done with powerful cores. Since Arm big.LITTLE is a Heterogeneous Multi-Processing (HMP) platform with simple, low powered cores and more advanced faster, power hungry cores on the same SoC. The simple cores can be used for the access phase and the powerful cores for the execute phase.

One system that uses the Arm big.LITTLE technology is the ODROID XU4. The ODROID XU4 computing board has a Samsung Exynos5422[8] Cortex-A15 2Ghz and Cortex-A7 Octa core CPUs. Exynos5422 cores are divided into two clusters: one with four A15 cores and the other one with four A7 cores. Each cluster has its L2 cache but can fetch data from L2 caches in other clusters[9].

How to measure/profiling cache loads and memory accesses is an important part of understanding the system operation and evaluation of effectiveness such as the DAE transformation.

1http://www.arm.com

(5)

A previous study by Anton Weber[10] that, target DAE on Arm:s HMP architecture big.LITTLE[4] has implemented transformation pattern for a selection of benchmarks in the SPEC CPU 2006 suite3. However, the goal of DAE is to move most of the misses in the Access phase, while Execute runs without misses. To find out whether this aim has been accomplished or not, this thesis work focuses on writing a profiling tool that can measure the efficiency of DAE by investigating the cache access/misses and CPU cycles in the original code and the DAE code (in the access and execute phases). This is done by measuring the cache loads, and memory accesses for the DAE transformation for the benchmarks done by the study mentioned.

The profiling tool provides information about the memory accessing behavior of the application, such as the number of memory access and refills for L1 cache, L2 cache, L2 of the other cluster per unit of time/per phase and how DAE behavior is influenced by the microarchitectural configurations.

Figure 1: Power consumption for Cortex-A15 and Cortex-A7[11].

2 Background

2.1 Decoupled Access-Execute

To improve performance and decrease time interval between stimulation and response when accessing data from main memory, cache and hardware prefetchers have been introduced. However, the effect on capacity is still limited in current computer ar- chitecture. The processor will have to wait for data to arrive this affects both the overall runtime of programs in a negative way, but it also causes unnecessary energy consumption, which is partly explained by the fact that the processor remains at full frequency while it waits for new data to compute. If the frequency were lower during stalls, energy consumption would be reduced but at the cost of slower computations and more time for program execution.

Spiliopoulos et al. [12] studied whether it was possible to execute memory bound instructions that stall the CPU at a low frequency and during the compute-bound

3Libquantum, LBM and CIGAR

(6)

parts of a program would let the processor run at high frequency. To do so, the authors devised a method that both detects compute and memory bound regions of a program and scales the frequencies of the CPUs. This approach was only successful when the regions were coarse enough, to prevent DVFS from rapid frequency switching.

Koukos et al. [7] suggested a solution to this problem through decoupled Access Execute (DAE). This approach combines memory and calculated instructions into a program, which creates larger code regions thereby reducing the number of required frequency switches. This yields two separate phases, called access (memory-bound) and execute phase (compute-bound).

A set of compiler passes in LLVM was created by Jimborean et al. [13] making these transformations being performed at compile-time. The execute phase is simply the original code while the access phase is created by removing all none memory reads or address computations.

The difficulties in transforming general purpose applications are dealt with Software Multiversioned Decoupled Access-Execute (SMVDAE) [14]. It is hard to statistically measure the efficiency of the transformations, because of complex control flow and pointer aliasing. DAE targets large loops within the programs to create coarse-grained code regions. These loops are split into smaller slices that typically consist of several iterations of the original loop; this is done to maximize the amount of prefetch data that can be utilized in the execute phase. The ideal size for the chunk, the granularity, is cache and application dependent, as the amount of data accessed in the execution depends on the task.

2.2 Arm big.LITTLE

Arm has created a technology big.LITTLE, witch combines ultra energy efficient CPUs cores with high-performance cores in a heterogeneous multi-processing archi- tecture. The design allows the devices to conserve power during simple tasks, idle states, and simultaneously delivers high-performance on-demand. The ’big’ and ’LIT- TLE’ cores use two different micro-architectures, but use the same Instruction Set Architecture(ISA) to be able to run the same code. A ’big’ core is typically an OoO superscalar architecture to deliver performance, while the ’LITTLE’ core uses ultra energy efficient simple in-order designs.

Arm ’big.Little’ configuration CPUs are grouped in two clusters; L2 cache is shared cluster. An interconnect connects the clusters and other peripherals such as GPU to the main memory, as shown in figure 2.

Arms Advanced Microcontroller Bus Architecture (AMBA) used for the interconnect for system-wide coherency through the AMBA AXI Coherency Extensions (ACE) and ACE-Lite [16]. These protocols allow memory coherency across CPUs and snooping, one of the prerequisites for big.LITTLE processing [4].

(7)

Figure 2: The big.LITTLE processing system[15].

(8)

2.3 Decoupled Access-Execute on Arm big.LITTLE

The Arm ’big.LITTLE’ technology provides fast power hungry ’big’ cores together with ultra energy efficient ’LITTLE’ cores on the same SoC. The DAE splits the program in the ’access’ and ’execute’ phase, the first is memory-bound having a low- performance requirement and the second compute-bound with a high-performance requirement. If the access phase is migrated to the ’LITTE’ core energy can be saved due to ultra energy efficient architecture without performance sacrifices. The execute phase can execute at high-frequency on the ’big’ core without having to wait for data minimizing time on the fast but power-hungry core.

Weber et al.[17] demonstrate a method for a thread-based DAE implementation that specifically targets the hardware features or ARM big.LITTLE. The implementation spawns two threads for the ’access’ and ’execute’ phase; the first is pinned to a

’LITTLE’ core and the second to a ’big’ core. This is done for hot-loops[18] that are the target for transformation in Weber’s work. Loops is also chunked in the same way as seen in Koukos et al.[14] SMVDAE, this is illustrated in Figure 3. To keep the threads synchronized between phases Weber et al. used mutex locks shown in Figure 4. The methodology/transformation was applied manually to a selection of benchmarks.

Figure 3: Splitting and chunking loop in DAE on big.LITTLE implementation[10].

(9)

Figure 4: Synchronization between individual phases, DAE on big.LITTLE by Weber[10].

3 Related work

Marciniwski[19] uses a modified version of Fiasco.OC revision r62, to obtain time with measurements on Cortex-A9. The kernel was modified, allowing user-mode access to a performance counter for measurements number of cycles performed by the CPU.

Emanuele et al.[20] investigate how HSA asymmetric multiprocessor system can be used to save energy. The latter proposed, workload-aware run-time resource man- agement policy, optimizing the system power consumption while maintaining Quality of Service. The result was evaluated on an Odroid-XU3 that is power by Samsung Exynos5422 that is also found in Odroid-XU4. The proposed policy was hade a higher throughput and power efficiency than current heterogeneous schedulers.

Hahnel et al.[21] investigate the energy characters of Odroid XU+E and the if energy- aware resource management has any potential on such platform. The Odroid XU- E feature a Samsung Exynos5 with four Cortex-A15 and four Cortex-A7 in Arm big.LITTLE configuration. Hahnel et al. found out that the optimal CPU and fre- quency are very application dependent.

(10)

4 Methodology

This section describes the implementation of the profiler tool developed for measuring cache uses with Arm Performance Monitoring Unit(PMU).

4.1 Implementation of framework for collecting memory ac- cess events using Arm PMU

The profiling tool constructed in this paper was written in C together with inline assembly, which was chosen for the implementation due to the need of low-level hard- ware accesses in conjunction with low overhead.[22].

The performance counter can be accessed and configured through CP15 system control coprocessor or external Advanced Peripheral Bus(APB) interface. For this study the CP15 coprocessor for accessing the PMU was used. This was motivated by the fact that only the CP15 coprocessor method was available on our hardware.

The Cortex-A7 has four 32bit event counters and one 32bit clock cycle, counter illus- trated in Figure 8. While the Cortex-A15 has six 32bit event counters but also one 32bit clock cycle counter. Each event counter can be set to listen to one event type (refer Table 1). An armed/activated counter was incremented on each time an event occured.

4.2 Enable user space access

The performance counters are not accessible from user space by default due to security concerns. To access the counter from user space PMUSERENR.EN bit has to be set in the User Enable Register, as they are only writable in Privileged mode. Writing this bit can be done by constructing a small driver, that serves the purpose to set the latter. Figure 5 shows the assembly command for setting PMUSERENT.en where

<Rd> is a register containing 1 for setting the bit or 0 for clearing the needed to set.

Figure 6 contains source code for the driver described above.

MCR p15 , 0 , < Rd > , c9 , c14 , 0

Figure 5: Write PMUSERENR Register

(11)

// C o d e b a s e d on h t t p :// n e o c o n t r a . b l o g s p o t . se / 2 0 1 3 / 0 5 / user - mode - p e r f o r m a n c e - c o u n t e r s - for . h t m l

# i n c l u d e < l i n u x / m o d u l e . h >

# i n c l u d e < l i n u x / k e r n e l . h >

# i n c l u d e < l i n u x / i n i t . h >

# i n c l u d e < l i n u x / smp . h >

# d e f i n e D R V R _ N A M E " e n a b l e _ a r m _ c p u _ c o u n t e r s "

s t a t i c v o i d e n a b l e _ c p u _ c o u n t e r s ( v o i d * d a t a ) {

u i n t 3 2 _ t r = 0;

u i n t 3 2 _ t p m c r ;

/* E n a b l e user - m o d e a c c e s s to c o u n t e r s . */

asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c14 , 0 " :: " r " (1) ) ; /* P r o g r a m PMU and e n a b l e all c o u n t e r s */

p m c r = 1; // e n a b l e

p m c r |= 2; // r e s e t all c o u n t e r s p m c r |= 4; // r e s e t C C N T

p m c r |= 8; // c y c l e d i v i d e r

asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c14 , 1 " :: " r " (0 x0 ) ) ; asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c12 , 0 " :: " r " ( p m c r ) ) ; asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c12 , 1 " :: " r " (0

x 8 0 0 0 0 0 0 f ) ) ; }

s t a t i c v o i d d i s a b l e _ c p u _ c o u n t e r s ( v o i d * d a t a ) {

/* D i s a b l e PMU */

asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c12 , 0 " :: " r " (0) ) ; /* D i s a b l e user - m o d e a c c e s s to c o u n t e r s . */

asm v o l a t i l e ( " mcr p15 , 0 , %0 , c9 , c14 , 0 " :: " r " (0) ) ; }

s t a t i c int _ _ i n i t i n i t ( v o i d ) {

o n _ e a c h _ c p u ( e n a b l e _ c p u _ c o u n t e r s , NULL , 1) ; r e t u r n 0;

}

s t a t i c v o i d _ _ e x i t f i n i ( v o i d ) {

o n _ e a c h _ c p u ( d i s a b l e _ c p u _ c o u n t e r s , NULL , 1) ; }

m o d u l e _ i n i t ( i n i t ) ; m o d u l e _ e x i t ( f i n i ) ;

Figure 6: userspace mode driver

4.3 Access PMU registers

The Performance Monitoring Unit(PMU) is managed by the p15 coprocessor. Inter- facing with the relevant register on the CP15 can simply be done using the assembler instructions MRC(Move from Coprocessor) and MCR(Move to Coprocessor). There exists a parameter for the MCR and MRC for each register that is used by the PMU, refer Table 2.

(12)

Table 1: Selection of Cortex-A15 Performance monitor events

number mnemonic Event name

0x00 SW INCR Instruction architecturally executed, condi- tion code check pass, software increment 0x01 L1I CACHE REFILL Level 1 instruction cache refill

0x02 L1I TLB REFILL Level 1 instruction TLB refill 0x03 L1D CACHE REFILL Level 1 data cache refill

0x04 L1D CACHE Level 1 data cache access

0x05 L1D TLB REFILL Level 1 data TLB refill

0x08 INST RETIRED Instruction architecturally executed

0x09 EXC TAKEN Exception taken

0x0A EXC RETURN Instruction architecturally executed, condi- tion code check pass, exception return 0x0B CID WRITE RETIRED Instruction architecturally executed, condi-

tion code check pass, write to CONTEXTIDR 0x10 BR MIS PRED Mispredicted or not predicted branch specula-

tively executed

0x11 CPU CYCLES Cycle

0x12 BR PRED Predictable branch speculatively executed

0x13 MEM ACCESS Data memory access

0x14 L1I CACHE Level 1 instruction cache access

0x15 L1D CACHE WB Level 1 data cache write-back

0x16 L2D CACHE Level 2 data cache access

0x17 L2D CACHE REFILL Level 2 data cache refill 0x18 L2D CACHE WB Level 2 data cache write-back

0x19 BUS ACCESS Bus access

0x1A MEMORY ERROR Local memory error

0x1B INST SPEC Instruction speculatively executed

0x1C TTBR WRITE RETIRED Intruction architecturally executed, condition code check pass, write to TTBR

0x1D BUS CYCLES Bus cycle

0x40 L1D CACHE LD Level 1 data cache access, read 0x41 L1D CACHE ST Level 1 data cache access, write 0x42 L1D CACHE REFILL LD Level 1 data cache refill, read 0x43 L1D CACHE REFILL ST Level 1 data cache refill, write 0x46 L1D CACHE WB VICTIM Level 1 data cache write-back, victim

0x47 L1D CACHE WB CLEAN Level 1 data cache write-back, cleaning and coherency

0x48 L1D CACHE INVAL Level 1 data cache invalidate 0x4C L1D TLB REFILL LD Level 1 data TLB refill, read 0x4D L1D TLB REFILL ST Level 1 data TLB refill, write 0x50 L2D CACHE LD Level 2 data cache access, read 0x51 L2D CACHE ST Level 2 data cache access, write 0x52 L2D CACHE REFILL LD Level 2 data cache refill, read 0x53 L2D CACHE REFILL ST Level 2 data cache refill, write 0x56 L2D CACHE WB VICTIM Level 2 data cache write-back, victim

0x57 L2D CACHE WB CLEAN Level 2 data cache write-back, cleaning and coherency

0x58 L2D CACHE INVAL Level 2 data cache invalidate

0x62 BUS ACCESS SHARED Bus access, Normal, Cacheable, Shareable

(13)

Table 2: Selection of PMU register internal CP15 interface[5]

CRn Op1 CRm Op2 Name Type Description

c9 0 c13 2 PMXEVCNTR RW Event Count Register

c9 0 c13 0 PMCCNTR RW Cycle Count Register

c9 0 c13 1 PMXEVTYPER RW Event Type Select Register

c9 0 c12 1 PMCNTENSET RW Count Enable Set Register

c9 0 c12 1 PMCNTENCLR RW Count Enable Clear Register

c9 0 c12 3 PMOVSR RW Overflow Flag Status Register

c9 0 c12 4 PMSWINC WO Software Increment Register

c9 0 c14 3 PMOVSSET RW Overflow Status Set Register

c9 0 c12 0 PMCR RW Control Register

c9 0 c14 0 PMUSERENR RW User Enable Register

c9 0 c12 5 PMSELR RW Event Counter Selection Register

4.4 Using performance counters

To use the PMU, the Performance Monitor Control Register(PMCR) must be set to 0x06 which will disable and reset the performance counters. The counter overflow bit also needs to be cleared, which is done by writing 1 at bit[n] (where n corresponds to a counter) for each overflow bit to be reset to Overflow Flag Status(PMOVSR).

Configuring what event to be monitored by an event counter are done by selecting the counter to be configured with Event Counter Selection Register (PMSELR), fol- lowed by writing the event number to be monitored to Event Type Select Register (PMXEVTYPER).

Start counters by setting bit[n] in Performance Monitors Count Enable Set Register PMCNTENSET. For example enabling counters, 0-3 are done by writing 0b1111 to PMCNTENSET. Stop counters are done in the same way as for start counter except Performance Monitors Count Enable Clear Register (PMCNTENCLR) is used instead. Reading a counter value is done by selecting a counter to be read, followed by reading Event Count Register PMXEVCNTR.

Figure 7 shows a code for using the PMU.

(14)

w r i t e _ P M C R (0 b 0 1 1 0 ) ;// d i s a b l e and r e s e t c o u n t e r s

w r i t e _ P M O V S R (0 b11 ) ;// c l e a r o v e r f l o w b i t s for c o u n t e r 0 -1 w r i t e _ P M S E L R (0) ;// s e l e c t c o u n t e r 0

w r i t e _ P M X E V T Y P E R (0 x03 ) ;// c o n f i g u r e c o u n t e r 0 for 0 x03 e v e n t s

w r i t e _ P M S E L R (1) ;// s e l e c t c o u n t e r 1

w r i t e _ P M X E V T Y P E R (0 x04 ) ;// c o n f i g u r e c o u n t e r 1 for 0 x04 e v e n t s

w r i t e _ P M C N T E N S E T (0 b11 ) ;// s t a r t c o u n t e r s 0 -1 // //

// c o d e to be m e s u r e d // //

w r i t e _ P M C N T E N C L R (0 b11 ) ;// s t o p c o u n t e r s 0 -1 w r i t e _ P M S E L R (0) ;// s e l e c t c o u n t e r 0

p r i n t f ( " L1D c a c h e r e f i l l : % u \ n " , r e a d _ P M X E V C N T R () ) ; //

r e a d and p r i n t c o u n t e r 0 v a l u e w r i t e _ P M S E L R (1) ;// s e l e c t c o u n t e r 1

p r i n t f ( " L1D c a c h e a c c e s s : % u \ n " , r e a d _ P M X E V C N T R () ) ; //

r e a d and p r i n t c o u n t e r 1 v a l u e

Figure 7: Code using PMU for capturing L1D cache refill and L1D cache access

Figure 8: Cortex-A7 PMU block diagram[6]

4.5 CCI-400 Cache Coherent Interconnect

The Cortex-A7 (LITTLE) cluster is connected to the Cortex-A15 (big) cluster by the CCI-400. Any snoop data will be transferred over the bus by CCI-400. The Cortex- A7 and Cortex-A15 do not have any PMU events that capture snooping between the CPU-clusters4. The CCI-400 have an own PMU that can capture snoop-rete between clusters. However, measurements from CCI-400 PMU were not obtained in this study,

(15)

resources such as the implementation guide(IG) are confidential and is only available to licensees[23].

5 Evaluation

5.1 Environmental setup

The benchmark was run on the ODROID-XU4 with Ubuntu 16.04 kernel 3.10 LTS.

The core 3 and 7 was disabled from the Linux task scheduler and the benchmarks were pinned to use these cores witch were run at the maximal frequency. The settings for the benchmark runs were stored in a remote MongoDB database, a Python script picks a task(benchmark setup and what to measure). A benchmark was compiled with the settings from the task witch was then executed. The result was exported in JavaScript Object Notation(JSON) form and stored in the database. This setup supports running on multiple ODROID-XU4 in parallel speeding up the time for getting results.

5.2 Benchmark description

libquantum

The libquantum6 benchmark is a quantum computers simulation and part of the SPEC CPU2006 benchmark suite[24]. For this benchmark, a hot loop with a regular memory access pattern was targeted for the DAE code transformation. On each loop iteration, a bitwise XOR operation is performed on a struct member; this is com- putationally simple. With a simple access pattern of the loop, hardware-prefetchers should be able to predict what data to fetch, which makes DAE transformation not useful in this case.

LBM

LBM is a benchmark from SPEC CPU2006[25] that simulate incompressible fluids in a three dimensions space with the Lattice Boltzmann Method[26]. DAE transforma- tion was done on a hot loop[18] featuring irregular memory accesses and conditional branching with limited influence on the control flow. This if-condition only affects what operation is performed on the data and not what data are used. With this limited control flow, it becomes effortless to know what data to prefetch in the access phase.

CIGAR

The CIGAR benchmark is a genetic algorithm search which injects problem spe- cific knowledge obtained from previous solutions to reduce search time[27][28]. DAE transformation was applied to a function with memory accesses with a high degree of indirection. The loop performs swapping of two values in an integer array and two value in a struct are compared to determine a new maximum.

6http://www.libquantum.de

(16)

5.3 Result

This section addresses what impact DAE has on CPU cycles and cache behavior;

what it means for performance and energy, how caches are affected by prefetching.

The snoop rate will not be addressed since it was not possible to obtain on the current platform.

Figure 9:

Red: Original code(execute phase without prefetching) Blue solid: DAE execute phase(prefetching by the access phase) Blue dashed: DAE access phase(prefetching for the execute phase) Figure 9 illustrates CPU cycles for the access/execute with or without prefetching. It can be seen that for CIGAR and LBM the access phase prefetching causes a reduction in CPU cycle on the ’big’ core, that is important for saving energy. A fine-grained approach yielded the best result for the benchmarks CIGAR and LBM with an ob- served reduction of CPU cycle up to 29% and 23% respectively, for the execute phase.

With the introduction of prefetch, additional CPU cycles are introduced on the en- ergy efficient ’LITTE’ core in the access phase. The combined execution of ’access’ +

’execute’ has a higher value than CPU cycle for the execute phase without prefetch.

For the CIGAR benchmark with the lowest granularity, ’access’ + ’execute’ phase has a combined CPU cycles of 5.6 + 6.4 = 12 (1e11) for prefetching and 9 (1e11) without prefetching for the lowest granularity. That gives a difference for the execute phase that is 9 − 6.4 = 2.6, in the best case. To be able to save any energy we need 5.6 ∗ A7 energyP erCycle ≤ 2.6 ∗ A15 energyP erCycle, which means the Cortex-A7 need to be more than 2.15 (= 5.6/2.6) times energy efficient than Cortex-A15 at this task. DAE transformation shows a promising result for both CIGAR and LBM with a higher IPC for the execute phase.

(17)

Figure 10:

Red: Original code(execute phase without prefetching) Blue solid: DAE execute phase(prefetching by the access phase) Blue dashed: DAE access phase(prefetching for the execute phase)

Figure 10 shows that CIGAR’s execute phase with prefetching have the best IPC at the lowest granularity at approximately 0.25 IPC. With no prefetching, the IPC is down to 0.176-0.183 IPC. It can also be observed that for the LITTLE core access phase we have a higher IPC than the execute phase on the big core running without prefetching. with the no prefetching on the big core. For the LBM benchmark IPC has the highest value of 0.52 IPC for the execute phase with prefetching and 0.39 IPC for the same phase without prefetching. The access phase has the lowest IPC value for LBM with 0.13 IPC.

The libquantum benchmark does not seem to have any benefits of the DAE, according to IPC in Figure 10 that shows 1.4 IPC for the execute phase. Cortex-A15 has a superscalar architecture that makes it possible for execution with higher than one that instruction per cycle[5][29].

(18)

Figure 11:

Red: Original code(execute phase without prefetching) Blue solid: DAE execute phase(prefetching by the access phase) Blue dashed: DAE access phase(prefetching for the execute phase)

(19)

Figure 13:

Red: Original code(execute phase without prefetching) Blue solid: DAE execute phase(prefetching by the access phase) Blue dashed: DAE access phase(prefetching for the execute phase)

Figure 14:

Red: Original code(execute phase without prefetching) Blue solid: DAE execute phase(prefetching by the access phase) Blue dashed: DAE access phase(prefetching for the execute phase)

(20)

The CIGAR benchmark has an irregular access pattern and seems to benefit the most of DAE, according to IPC, (Figure 10). All L1 and L2 cache access and refills, Figure 11, 12, 13 and 14 have higher values for no prefetching execute phase, in the CIGAR. This result could mean that snooping of data over CCI course is a reduction in cache refills for L1 and L2 cache in the Cortex-A15 cluster. Also, the decrease in refills causes cache access to be lowered. A low cache utilization can be a problem for performance, due to the longer access time for uncached data. This is however not seen for CIGAR, according to Figure 10, that instead shows a performance increase.

Accessing memory that is not available in the cluster will broadcast snoop request on CCI-400 bus. Receiving a snoop request will trigger a cache lookup and will be answered if the requested data are available. Otherwise, if the requested data are not available, they will be fetched from main memory, which has the highest latency.

The higher performance IPC Figure 10 demonstrates that the time saved by avoiding fetching data from main memory exceeds the negative effect of snooping from the other cluster in this case.

Figure 14 shows that libquantum has no L2 misses for the original version, when no software prefetching is performed. This indicates that the hardware prefetcher has successfully prefetched the required data, which is expected given the simple memory access pattern of libquantum. It is unclear why L2 misses increase with software prefetching done by the LITTLE core, but it could be due to the software prefetcher interfering with the hardware prefetcher. However, this does not affect the runtime according to Figure 9 and Figure 10.

6 Conclusions and future work

This thesis desscribes a profiler that monitors the Performance Monitoring Unit(PMU) of the CPUs measuring L1/L2 access and misses; it can also capture a variety of dif- ferent events, that are supported by Cortex-A7 and Cortex-A15 PMUs, see Table 1. However, the profiler is not able to measure snoop-rate between clusters due to hardware limitations of the ODROID-XU4. It is shown that DAE on big.LITTLE has a potential for energy savings, especially with applications that feature indirec- tion in memory accesses. A limitation of the current platform used is that ’big’ and

’LITTLE’ core are not in the same cluster and don’t share a common cache. All data transferred between the access and execute thread are currently snooped over the CCI-400[23], which can cause a limitation in performance depending on the CCI bandwidth. Next-generation big.LITTLE Cortex-A CPU clusters can mix ’big’ per- formance CPUs with high efficiency LITTLE CPUs in the same cluster with a shared coherent LLC memory. Arm calls this new technology DynamIQ big.LITTLE[30].

Arm DynamIQ opens up new possibilities for DAE code transformation. New levels of energy efficiency can be reached with a finer-grained DVFS, a more rapid power, state transition mechanism and a shared cache for ’big’ and ’LITTLE’ CPUs. The DynamIQ is a new technology with a promising future with DAE code transformation.

The overhead stemming from the spawning of threads and thread synchronization was not studied in this thesis. The implementation used for synchronization was performed by Anton Weber[10] by making use of mutex locks and pthreads[31]. It would be interesting to study if synchronization can be accomplished more efficiently.

For example, using the Interrupt Controller to trigger synchronization between the phases/cores[32], that is an essential part the of a real world implementation. This study is left for future work.

(21)

7 References

[1] N. R. Council, The Future of Computing Performance: Game Over or Next Level? Washington, DC: The National Academies Press, 2011.

[2] M. Murdocca and V. P. Heuring, Principles of Computer Architecture. Prentice Hall, 1999.

[3] Chris Bidmead, “ARM creators Sophie Wilson and Steve Furber,” 2017.

[Online] accessed 2017-09-11. Available at http://www.theregister.co.uk/

2012/05/03/unsung_heroes_of_tech_arm_creators_sophie_wilson_and_

steve_furber/.

[4] ARM Limited, “big.LITTLE Technology: The Future of Mobile,” tech. rep., 2013.

[5] ARM, “Cortex-A15 MPCore Processor Technical Reference Manual,” 2013. Re- vision: r4p0.

[6] ARM, “Cortex-A7 MPCore Technical Reference Manual,” 2013. Revision: r0p5.

[7] K. Koukos, D. Black-Schaffer, V. Spiliopoulos, and S. Kaxiras, “Towards more efficient execution: A decoupled access-execute approach,” in Proceedings of the 27th international ACM conference on International conference on supercomput- ing, pp. 253–262, ACM, 2013.

[8] Chris Bidmead, “Mobile Processor Exynos 5 Octa (5422) The big.LITTLE Octa- core Mobile Processor with HMP Solution ,” 2017. [Online] accessed 2017-09- 11. Available at http://www.samsung.com/semiconductor/minisite/Exynos/

Solution/MobileProcessor/Exynos_5_Octa_5422.html.

[9] D. A. Patterson and J. L. Hennessy, Computer Organization and Design MIPS Edition: The Hardware/Software Interface (The Morgan Kaufmann Series in Computer Architecture and Design). Morgan Kaufmann, 2013.

[10] A. Weber, “Decoupled access-execute on arm big.little,” Master’s thesis, Uppsala University, Department of Information Technology, 2016.

[11] P. Greenhalgh, “big.little processing with arm cortex-a15 & cortex-a7,” white paper, Arm, sep 2011.

[12] V. Spiliopoulos, S. Kaxiras, and G. Keramidas, “Green governors: A framework for continuously adaptive dvfs,” in Green Computing Conference and Workshops (IGCC), 2011 International, pp. 1–8, IEEE, 2011.

[13] A. Jimborean, K. Koukos, V. Spiliopoulos, D. Black-Schaffer, and S. Kaxiras,

“Fix the code. don’t tweak the hardware: A new compiler approach to voltage- frequency scaling,” in Proceedings of Annual IEEE/ACM International Sympo- sium on Code Generation and Optimization, p. 262, ACM, 2014.

[14] K. Koukos, P. Ekemark, G. Zacharopoulos, V. Spiliopoulos, S. Kaxiras, and A. Jimborean, “Multiversioned decoupled access-execute: the key to energy- efficient compilation of general-purpose programs,” in Proceedings of the 25th International Conference on Compiler Construction, pp. 121–131, ACM, 2016.

[15] B. Jeff, “big.little technology moves towards fully heterogeneous global task scheduling,” white paper, Arm, nov 2013.

[16] Stevens, Ashley, “Introduction to AMBA 4 ACER TM and big.LITTLETM Pro- cessing Technology,” tech. rep., 2013.

[17] A. Weber, K. Tran, S. Kaxiras, and A. Jimborean, “Decoupled access-execute on ARM big.little,” CoRR, vol. abs/1701.05478, 2017.

(22)

[18] P. Sadayappan, M. Parashar, R. Badrinath, and V. Prasanna, High Performance Computing - HiPC 2008: 15th International Conference, Bangalore, India, De- cember 17-20, 2008, Proceedings. Lecture Notes in Computer Science, Springer Berlin Heidelberg, 2008.

[19] M. Marciniewski, “Deployment and profiling of l4re on an arm cortex a plat- form.,” bachelor thesis, Uppsala University, Department of Information Technol- ogy, 2014.

[20] E. Del Sozzo, “Workload-aware power optimization strategy for het- erogeneous systems,” Master’s thesis, Politecnico di Milano, 2015.

http://hdl.handle.net/10589/111322.

[21] M. H¨ahnel and H. H¨artig, “Heterogeneity by the numbers: A study of the odroid xu+e big. little platform,” in Proceedings of the 6th USENIX Conference on Power-Aware Computing and Systems, HotPower’14, (Berkeley, CA, USA), pp. 3–3, USENIX Association, 2014.

[22] B. W. Kernighan and D. Ritchie, The C Programming Language, Second Edition.

Prentice-Hall, 1988.

[23] ARM, “ARM CoreLink CCI-400 Cache Coherent Interconnect Technical Refer- ence Manual,” 2015. Revision: r1p5.

[24] Bjrn Butscher and Hendrik Weimer, “462.libquantum SPEC CPU2006 Bench- mark Description File,” 2017. [Online] accessed 2017-09-11. Available at https:

//www.spec.org/cpu2006/Docs/462.libquantum.html.

[25] Thomas Pohl, “470.lbm SPEC CPU2006 Benchmark Description File,” 2017.

[Online] accessed 2017-09-11. Available at https://www.spec.org/cpu2006/

Docs/470.lbm.html.

[26] Y. H. Qian, D. D’Humires, and P. Lallemand, “Lattice bgk models for navier- stokes equation,” EPL (Europhysics Letters), vol. 17, no. 6, p. 479, 1992.

[27] University of Nevada, Reno, “Evolutionary Computing Systems Lab,” 2016. [On- line] accessed 2016-05-28. Available at http://ecsl.cse.unr.edu/.

[28] S. J. Louis and J. McDonnell, “Learning with case-injected genetic algorithms,”

IEEE Transactions on Evolutionary Computation, vol. 8, pp. 316–328, Aug 2004.

[29] M. Johnson, Superscalar Microprocessors Design. Prentice Hall, 1990.

[30] Arm, “Arm DynamIQ technology,” 2017. [Online] accessed 2017-09-11. Available at https://developer.arm.com/technologies/dynamiq.

[31] B. Nichols, Pthreads programming: Bradford Nichols, Dick Buttlar, and Jacque- line Proulx Farrell. OReilly, 1996.

[32] ARM, “ARM CoreLink GIC-400 Generic Interrupt Controller Technical Refer- ence Manual,” 2012. Revision: r0p1.

References

Related documents

The results show that five of the articles found a positive correlation between time spent on extramural English activities and English grades and/or vocabulary, while on

Greene söker förklaringar till barns problemskapande beteende i den enskilda individens outvecklade förmågor, men menar att problem uppstår i relation till andra och att

In this chapter, which corresponds to Paper V in this thesis, we introduced a hybrid private/shared data classification and coherence scheme, where the decision to classify the

lIuoh lnlol'llllltion 11 tl.lund in library copie. of magaainee and nne pa~er. Prominent among the.e publiclIIltion. are the !,Ii.ning and So:I.enU'Uc Pr •••• Eng1n8if.ring and

Another goal is, to demonstrate the possibility of closed loop control of the foam level in the water model using the sound signal as measurement.. Foam level control in a LD-

Thereafter, we discuss the theoretical considerations and the concrete formula linked to our aggregation of these aspects with polyarchy into high level measures

Keywords Slice-aware Memory Management, Last Level Cache, Non-Uniform Cache Architecture, CacheDirector, DDIO, DPDK, Network Function Virtualization, Cache Partitioning,

The Level-1 (L1) cache has low capacity but high processing speed, while the Level-2 (L2) cache cluster consists of multiple cooperated caches which have high