MemGuard on Raspberry Pi 3

Similar documents
Embedded Linux. A Tour inside ARM's Kernel

Installation Guide for Linux

EECS750: Advanced Operating Systems. 2/24/2014 Heechul Yun

Davide Cavaliere 18 th February 2017

Installation guide. Step1. Install the OS for Raspberry Pi 3. Go to to download Raspbian to the PC.

RETROPIE INSTALLATION GUIDE

Raspberry Pi Kernel-o-Matic

Raspberry Pi Network Boot

Lab2 - Bootloader. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Improving Real-Time Performance on Multicore Platforms Using MemGuard

Playing with Linux CGROUP

Operating System. Hanyang University. Hyunmin Yoon Operating System Hanyang University

Raspberry Pi NTP Clock Setup Guide

Advantech General FAQ. How to change ubuntu specific kernel for quick cross test

ECE 471 Embedded Systems Lecture 15

Moving Your Application on the Raspberry Pi to the UC-8100-LX Computer. 1 Background Requirement Overview System Environment...

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

An introduction of operating system project. Seo Bon Keun

5inch HDMI Display User Manual

Preparing SD card for Pi

7inch HDMI Display-B. User Manual. product description

Adafruit's Raspberry Pi Lesson 6. Using SSH

Idea6410 Ubuntu User Manual V 0.19

Formatting 1. Commands starting with $ are Linux console commands on the host PC:

10.1inch HDMI LCD (B) User Manual

Adafruit NFC/RFID on Raspberry Pi

raspberrypi login: pi Password: raspberry Linux raspberrypi #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l

Toward SLO Complying SSDs Through OPS Isolation

Adafruit NFC/RFID on Raspberry Pi

Adding a Real Time Clock to Raspberry Pi

Raspberry Pi Tutorial 2

SOFT CONTAINER TOWARDS 100% RESOURCE UTILIZATION ACCELA ZHAO, LAYNE PENG

Making Open Source Hardware for Retrogaming on Raspberry Pi. Leon Anavi Konsulko Group

1. Install a Virtual Machine Download Ubuntu Create a New Virtual Machine Seamless Operation between Windows an Linux...

Managing Memory for Timing Predictability. Rodolfo Pellizzoni

Using ROS with RedHawk Linux on the NVIDIA Jetson TX2

A Step by Step Guide to Installing VPN on Raspberry Pi. Whitepaper

UM2375 User manual. Linux driver for the ST25R3911B/ST25R391x high performance NFC frontends. Introduction

PiCloud. Building owncloud on a Raspberry PI

NFC in Linux How to get started with the PN7120S controller board. Public MobileKnowledge July 2015

PERF performance-counter for Odroid XU3/XU4

Supporting Temporal and Spatial Isolation in a Hypervisor for ARM Multicore Platforms

Tizen.IoTivity.Init. Tizen IoTivity 를시작하기위한환경설정. Geunsun Lee

Travis Cardwell Technical Meeting

The Broadband Ham Net community has had a need for a stand alone time server for their meshes. This document will attempt to fill in this need.

LotOS Framework. Getting Started Guide for Banana Pi. Copyright (C) 2015 ilbers GmbH Revision 1.1,

Masternode Setup Guide

Zephyr Kernel Installation & Setup Manual

Presented By: Gregory M. Kurtzer HPC Systems Architect Lawrence Berkeley National Laboratory CONTAINERS IN HPC WITH SINGULARITY

Contents. Crave Masternode Setup Guides. Single / Multiple Local Masternode(s) Single Masternode using a VPS. Multiple Masternodes using a VPS

RaRa Academy: Raspberry Pi. Karl Heinz Kremer - K5KHK

Performance Optimization for an ARM Cortex-A53 System Using Software Workloads and Cycle Accurate Models. Jason Andrews

Networked Thermal Printer using Raspberry Pi and CUPS

This is the Memory Map section of the MIPS software training course.

Simulating Multi-Core RISC-V Systems in gem5

Adafruit Ultimate GPS on the Raspberry Pi

Protecting Real-Time GPU Kernels on Integrated CPU-GPU SoC Platforms

Building CircuitPython

LITMUS RT : A Hands-On Primer

Preempt-RT Raspberry Linux. VMware Tiejun Chen

Bluetooth Keyboard Setup Instructions

Single Core Equivalent Virtual Machines. for. Hard Real- Time Computing on Multicore Processors

(The DMRplus Master software is provided to Amateur Radio license holders only and not available here)

Linux. An introduction. Aurélien Villani 01/2018

Linux U-Boot and Kernel Users Guide

Perf with the Linux Kernel. Copyright Kevin Dankwardt

PiCAN 2 USER GUIDE V1.2

REX-RED Community Android 4.3

RaspiDigiHamClock. Raspberry Pi Amateur Radio Digital Clock. v WA4EFH R.Grokett

Die Brummbeere Documentation

Raspberry Pi Introduction

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

Taming Non-blocking Caches to Improve Isolation in Multicore Real-Time Systems

POSTouch Open Source Driver (OSE) Installation Guide

By: Yushi Wang Partners: Shen Yue and Yubing Xu Group 6. How to Setup Pandaboard ES Software Environment for UAV Project

Setting up a Raspberry Pi as a WiFi access point

Nano RPI Module. User Guide. Rev 1.0, Apr 2017

MAKEVMP " 320 x 480 TOUCHSCREEN FOR RASPBERRY PI (ILI9341) USER MANUAL

5 inch HDMI Display-B

Installing MediaWiki using VirtualBox

Power Measurements using performance counters CSL862: Low-Power Computing By Radhika D (2014SIY7530)

KeyStone II. CorePac Overview

A Case for High Performance Computing with Virtual Machines

The distcc Utility for Remote Compiling

XLink Kai Raspberry Pi Beginners Tutorial

Enabling NVMe I/O Scale

Introduction to the Raspberry Pi AND LINUX FOR DUMMIES

Raspberry Pi 2b PART 1. Table of Contents. Step by step guide. 1. Hardware (0:05) RS Online (ex-tax prices)... 3 MSY ebay...

CS 300 Data Structures

Rapoo E6700 Setup Instructions

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Pianoteq 6 Raspberry Pi 3 Station. By Edgar Bustamante

Revolutionizing the Datacenter. Join the Conversation #OpenPOWERSummit

Configuring and Building Palacios/Linux

3.5 Inch TFT Display

Raspberry Pi Class Ed 299. Mike Davis Truman College 5/26/2015

docker & HEP: containerization of applications for development, distribution and preservation

Raspberry Pi Kernel Install. By: Daniel Rizko

562 IEEE TRANSACTIONS ON COMPUTERS, VOL. 65, NO. 2, FEBRUARY 2016

Alpine Linux Documentation

Transcription:

EECS 750 Mini Project #1 MemGuard on Raspberry Pi 3 In this mini-project, you will first learn how to build your own kernel on raspberry pi3. You then will learn to compile and use an out-of-source-tree kernel module (MemGuard). You should return mini-proj1-1.txt, mini-proj1-2.txt, mini-proj1-3.txt, mini-proj1-4.txt. Table of Content 1 Part 0. Install Raspbian 1 Part 1. Build your own kernel 1 Part 2. Worst-case memory interference experiment 2 Part 3. Build MemGuard kernel module 4 Part 4. Worst-case memory interference experiment w/ MemGuard 5 Part 0. Install Raspbian First thing first. Install the Raspbian OS on the Pi 3. A 32GB micro-sd card should be included in the DonkeyCar system box you received. Follow the detailed instruction in the following. Using NOOB may be easiest, but directly installing Raspbian is also not that hard. https://www.raspberrypi.org/downloads/ Part 1. Build your own kernel Once you boot to the Pi 3, it s time to install your own kernel. All the necessary information can be found in the following document. https://www.raspberrypi.org/documentation/linux/kernel/building.md Below is essentially a copy of the document above, with some additional commentary. $ sudo apt-get install git bc $ git clone --depth=1 https://github.com/raspberrypi/linux $ cd linux $ KERNEL=kernel7 $ make bcm2709_defconfig Before you begin, let s backup the current kernel just in case. $ sudo cp /boot/kernel7.img /boot/kernel7.img.backup

Then, do the following to build the kernel. $ make -j4 zimage modules dtbs Now, this will take about 1.5 hour. So, take a break, sleep, or watch a movie while the pi is busy compiling the kernel. After a long time, if the compilation was successful, proceed the following to install the compiled kernel (and other stuff). $ sudo make modules_install $ sudo cp arch/arm/boot/dts/*.dtb /boot/ $ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/ $ sudo cp arch/arm/boot/dts/overlays/readme /boot/overlays/ $ sudo cp arch/arm/boot/zimage /boot/$kernel.img If everything went smoothly, then reboot the system and check if the kernel is the one you just compiled. $ uname -a Linux raspberrypi 4.9.80-v7+ #1 SMP Mon Feb 12 23:07:22 UTC 2018 armv7l GNU/Linux Copy the output of uname -a command on your Pi 3 and save it as mini-proj1-1.txt file. You should return the Part 2. Worst-case memory interference experiment Install the IsolBench benchmark suite (as in HW#3) on the Pi 3. $ git clone https://github.com/csl-ku/isolbench $ cd IsolBench/bench $ make You will use the latency and bandwidth benchmarks in the rest of the project. So, let s install them. $ sudo cp latency bandwidth /usr/local/bin/ Now, we will conduct an experiment to see worst-case memory interference on the Pi 3. The basic setup is that you first measure the performance of the latency benchmark first alone in

isolation (Solo experiment) and then with three instances of the bandwidth benchmark (Corun experiment). First, let s measure the Solo baseline as follows. Here, the -c option specify the core. average 184.95 ns bandwidth 346.03 MB (330.00 MiB)/s Next, launch three instances of the bandwidth benchmark on core 1, 2, and 3, followed by the latency benchmark on core 0 as follows. $ for c in 1 2 3; do bandwidth -c $c -t 1000 & done average 563.22 ns bandwidth 113.63 MB (108.37 MiB)/s readsum 214745088000 You can see the performance of the latency benchmark is significantly worse than the solo performance. Next, repeat the Corun experiment, but with using -a write option when launching the bandwidth benchmark, which changes its memory access pattern from read to write. $ killall -9 bandwidth $ for c in 1 2 3; do bandwidth -a write -c $c -t 1000 & done average 1124.04 ns bandwidth 56.94 MB (54.30 MiB)/s readsum 214745088000 You can see the performance of the latency benchmark is dropped even further. Compared to its original Solo performance of 346 MB/s, it is now only able to achieve a pitiful 57 MB/s (just about 16% of the its original speed.) This is because the three co-scheduled bandwidth benchmark instances cause significant memory interference. Save the outputs of the experiments above as mini-proj1-2.txt file. You should return the Part 3. Build MemGuard kernel module Now, let s use MemGuard to mitigate the situation we observed in Part 2. First, build the memguard kernel module as follows.

$ git clone https://github.com/heechul/memguard $ cd memguard $ make If the build was successful, do the following to load the MemGuard kernel module. Here, g_hw_type=armv7 notifies the module to use L2 data cache refill performance counter. $ sudo bash # insmod./memguard.ko g_hw_type=armv7 If the load was successful (Note that the currently running kernel s version must match with the version of the kernel source code you used to build the module. If you completed Part 1, they should match,) do the following. # pushd /sys/kernel/debug/memguard/ # ls control limit usage # cat limit cpu budget (MB/s,pct,weight) ------------------------------- CPU0: 16384 (1000MB/s) CPU1: 16384 (1000MB/s) CPU2: 16384 (1000MB/s) CPU3: 16384 (1000MB/s) The limit file shows the current budget of each core. Change the budgets as follows. # echo mb 1000 100 100 100 > limit # cat limit cpu budget (MB/s,pct,weight) ------------------------------- CPU0: 16384 (1000MB/s) CPU1: 1638 (100MB/s) CPU2: 1638 (100MB/s) CPU3: 1638 (100MB/s) As you can see, the budgets of core1,2 and 3 are now adjusted to 100MB/s (1638 LLC misses per 1ms), while the core0 s budget is 1GB/s (16384 LLC misses per 1ms). Now, let s get back to the user-mode as follows. # suspend

Next, check if each core s budget is indeed enforced by MemGuard. Launch the bandwidth benchmark on Core 3 and 0, respectively, as follows. $ bandwidth -c 3 CPU3: B/W = 99.99 MB/s CPU3: average = 610.43 ns $ bandwidth -c 0 CPU0: B/W = 999.16 MB/s CPU0: average = 61.09 ns Save the outputs of the experiments above as mini-proj1-3.txt file. You should return the Part 4. Worst-case memory interference experiment w/ MemGuard You now repeat the Part 2. Because MemGuard is running, core 1, 2, and 3 are regulated at 100 MB/s at best. Solo baseline (incl. Memguard overhead)\ average 185.01 ns bandwidth 345.92 MB (329.89 MiB)/s Read interference $ for c in 1 2 3; do bandwidth -c $c -t 1000 & done average 209.59 ns bandwidth 305.36 MB (291.21 MiB)/s Write interference $ for c in 1 2 3; do bandwidth -a write -c $c -t 1000 & done average 233.36 ns bandwidth 274.25 MB (261.54 MiB)/s Save the outputs of the experiments above as mini-proj1-4.txt file. You should return the