nanoBench: A Low-Overhead Tool for Running Microbenchmarks on x86 Systems
Preprint
Abstract
We present nanoBench, a tool for evaluating small microbenchmarks using hardware performance counters on Intel and AMD x86 systems. Most existing tools and libraries are intended to either benchmark entire programs, or program segments in the context of their execution within a larger program. In contrast, nanoBench is specifically designed to evaluate small, isolated pieces of code. Such code is common in microbenchmark-based hardware analysis techniques. Unlike previous tools, nanoBench can execute microbenchmarks directly in kernel space. This allows to benchmark privileged instructions, and it enables more accurate measurements. The reading of the performance counters is implemented with minimal overhead avoiding functions calls and branches. As a consequence, nanoBench is precise enough to measure individual memory accesses. We illustrate the utility of nanoBench at the hand of two case studies. First, we briefly discuss how nanoBench has been used to determine the latency, throughput, and port usage of more than 13,000 instruction variants on recent x86 processors. Second, we show how to generate microbenchmarks to precisely characterize the cache architectures of eleven Intel Core microarchitectures. This includes the most comprehensive analysis of the employed cache replacement policies to date.Keywords
All Related Versions
- Version 1, 2019-11-08, ArXiv
- Version 2, 2020-03-07, ArXiv
- Published version: , 34.
This publication has 37 references indexed in Scilit:
- Efficient Characterization of Hidden Processor Memory Hierarchies2018
- Cache Attacks Enable Bulk Key Recovery on the Cloud2016
- Reverse Engineering Intel Last-Level Cache Complex Addressing Using Performance Counters2015
- Systematic Reverse Engineering of Cache Slice Selection in Intel Processors2015
- Collecting Performance Data with PAPI-C2010
- Investigating Cache Parameters of x86 Family Processors2009
- Timing predictability of cache replacement policiesReal-Time Systems, 2007
- Automatic Measurement of Instruction Cache CapacityLecture Notes in Computer Science, 2006
- Accurate Cache and TLB Characterization Using Hardware CountersLecture Notes in Computer Science, 2004
- Measuring cache and TLB performance and their effect on benchmark runtimesIEEE Transactions on Computers, 1995