Flash filesystem benchmarks

Similar documents
IPL+UBI: Flexible and Reliable with Linux as the Bootloader

Embedded Linux system development training 5-day session

NAND/MTD support under Linux

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

Current Challenges in UBIFS

Mobile phones Memory technologies MMC, emmc, SD & UFS

MTD Based Compressed Swapping for Embedded Linux.

Update on boot time reduction techniques

Setup Macronix NAND Flash on Freescale i.mx28 EVK

CSE 333 Lecture 9 - storage

S3C6410-TFAUbuntu Easy Guide

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

D1 - Embedded Linux. Building and installing an embedded and real-time Linux platform. Objectives. Course environment.

Android for IVI Android for IVI: overcoming enormous boot time

ARM Powered SoCs OpenEmbedded: a framework for toolcha. generation and rootfs management

File systems for flash devices

Project 3: An Introduction to File Systems. COP 4610 / CGS 5765 Principles of Operating Systems

Escalating Privileges in Linux using Fault Injection. September 25, 2017

How I survived to a SoC with a terrible Linux BSP

The Btrfs Filesystem. Chris Mason

TEFS: A Flash File System for Use on Memory Constrained Devices

Contents. Acknowledgments... xi. Foreword 1... xiii Pierre FICHEUX. Foreword 2... xv Maryline CHETTO. Part 1. Introduction... 1

OMAP3530 has 256MB NAND flash in PoP (PoP: Package-On-Package implementation for Memory Stacking) configuration.

ECE 598 Advanced Operating Systems Lecture 14

YAFFS A NAND flash filesystem

Anatomy of Linux flash file systems

[537] Flash. Tyler Harter

D1Y - Embedded Linux with Yocto

Linux. For BCT RE2G2. User Guide. Document Reference: BCTRE2G2 Linux User Guide. Document Issue: Associated SDK release: 1.

An Improved B+ Tree for Flash File Systems

JOURNALING FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 26

D1S - Embedded Linux with Ac6 System Workbench

Embedded Linux Primer, Second Edition

An Introduction to SPI-NOR Subsystem. By Vignesh R Texas Instruments India

Getting Started with BeagleBoard xm

Compressed Swap for Embedded Linux. Alexander Belyakov, Intel Corp.

Caching and reliability

How I survived to a SoC with a terrible Linux BSP

Routerboard 5xx. Hardware. Initial Installation

Computer System Management - File Systems

Adding SD card to WRT54GL

Project 3: An Introduction to File Systems. COP4610 Florida State University

Week 10 Project 3: An Introduction to File Systems. Classes COP4610 / CGS5765 Florida State University

EMSOFT 09 Yangwook Kang Ethan L. Miller Hongik Univ UC Santa Cruz 2009/11/09 Yongseok Oh

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

The Right Approach to Minimal Boot Times

Linux Filesystems Ext2, Ext3. Nafisa Kazi

Linux Files and the File System

Introduction to the TenByTen6410

File Systems. File system interface (logical view) File system implementation (physical view)

Track One Building a connected home automation device with the Digi ConnectCore Wi-i.MX51 using LinuxLink

Status of Embedded Linux. BoF October, Tim Bird CELF Architecture Group Chair

Linux Tiny Penguin Weight Watchers. Thomas Petazzoni Free Electrons electrons.com

Operating Systems. Mass-Storage Structure Based on Ch of OS Concepts by SGG

Swapping and embedded:

MCAM335x Linux User's Guide

Introduction p. 1 Why Linux? p. 2 Embedded Linux Today p. 3 Open Source and the GPL p. 3 Free Versus Freedom p. 4 Standards and Relevant Bodies p.

Introducing the Advanced XIP File System

File Systems Management and Examples

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

Optimizing Translation Information Management in NAND Flash Memory Storage Systems

I/O Stack Optimization for Smartphones

Operating Systems Design 14. Special File Systems. Paul Krzyzanowski

Partitioning Disks with parted

Computer Systems Laboratory Sungkyunkwan University

Windows Method Using Linux Live CD and Gparted

Azure Sphere: Fitting Linux Security in 4 MiB of RAM. Ryan Fairfax Principal Software Engineering Lead Microsoft

Linux SMR Support Status

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane

Journal Remap-Based FTL for Journaling File System with Flash Memory

Booting Linux Fast & Fancy. Embedded Linux Conference Europe Cambridge, Robert Schwebel

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

Familiar Linux for the ipaq H3975 (XScale Processor) CSC 714 Real Time Computing Systems Term Project

Status of Embedded Linux

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Ext4, btrfs, and the others

EECS 482 Introduction to Operating Systems

Main Points. File systems. Storage hardware characteristics. File system usage patterns. Useful abstractions on top of physical devices

Installing Linux (Chapter 8) Note packet # 4. CSN 115 Operating Systems Ken Mead Genesee Community College. Objectives

Filesystems in Linux. A brief overview and comparison of today's competing FSes. Please save the yelling of obscenities for Q&A.

OP-TEE Using TrustZone to Protect Our Own Secrets

Yocto Project and OpenEmbedded training 3-day session

CSE 451: Operating Systems Spring Module 12 Secondary Storage

Using Transparent Compression to Improve SSD-based I/O Caches

Disk Imaging with Knoppix

Presented by: Nafiseh Mahmoudi Spring 2017

CSE 451: Operating Systems Spring Module 12 Secondary Storage. Steve Gribble

Lab 1. OMAP5912 Starter Kit (OSK5912)

1 The Linux MTD, YAFFS Howto

Release Notes for QNX Neutrino BSP for Renesas SH7780 EDOSK 1.0.0#

IRON FOR JFFS2. Raja Ram Yadhav Ramakrishnan, Abhinav Kumar. { rramakrishn2, ABSTRACT INTRODUCTION

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CEC 450 Real-Time Systems

Operating Systems Design Exam 2 Review: Spring 2011

HiFlash: A History Independent Flash Device

망고 210 ICS mmc booting 메뉴얼 작성및 patch

Hard Disk Organization. Vocabulary

CS 416: Opera-ng Systems Design March 23, 2012

Transcription:

Embedded Linux Conference Europe 21 Flash filesystem benchmarks Michael Opdenacker Free Electrons Copyright 21, Free Electrons. 1

Free FreeElectrons Electrons Free embedded Linux and kernel materials http://free electrons.com/docs Linux BSPs, device drivers and plumbing Buildroot http://buildroot.org

Questions Who uses? logfs nftl? 3

Introduction Work started in 28 at ELC E Showed benchmarks on, and What has happened during the last 2 years Project continued with funding from the CE Linux Forum Automation scripts now supporting multiple boards New armel root filesystem for the tests (replaces Buildroot). Easier access to MTD and filesystem utilities. Udev simplifies the use of UBIFS. Now measuring driver initialization time through loading external modules (instead of static drivers boot time was not measured). LogFS mainlined in 2.6.34 4

http://www.linux mtd.infradead.org/doc/.html Today's standard filesystem for MTD flash Nice features: on the fly compression (saves storage space and reduces I/O), power down reliable, wear leveling and ECC. Standard file API JFFS2 filesystem Drawbacks: doesn't scale well Mount time depending on filesystem size: the kernel must scan the whole filesystem at mount time, to read which block belongs to each file. Need to use the CONFIG_JFFS2_SUMMARY kernel option to store such information in flash. This dramatically reduces mount time (from 16 s to.8s for a 128 MB partition). MTD driver Flash chip 5

http://www.yaffs.net/ Mainly supports NAND flash No compression Wear leveling, ECC, power failure resistant Standard file API YAFFS2 filesystem Fast boot time Code available in a separate git tree Should be included in the mainline kernel soon. MTD driver Flash chip 6

UBI (1) Unsorted Block Images http://www.linux mtd.infradead.org/doc/ubi.html Volume management system on top of MTD devices. Allows to create multiple logical volumes and spread writes across all physical blocks. Takes care of managing the erase blocks and wear leveling. Makes filesystem easier to implement. 7

UBI (2) UBI Logical Erase Blocks MTD Physical Erase Blocks Volume1 LEB LEB LEB Volume2 LEB LEB LEB LEB PEB PEB PEB PEB PEB PEB PEB PEB PEB Free block Free block 8

UBIFS http://www.linux mtd.infradead.org/doc/.html The next generation of the filesystem, from the same linux mtd developers. Available in Linux 2.6.27 Works on top of UBI volumes Has a noticeable metadata overhead on very small partitions (4M, 8M) Standard file API UBIFS UBI MTD driver Flash chip 9

LogFS http://en.wikipedia.org/wiki/logfs New comer in mainline (integrated in 2.6.34) Still experimental (at least in 2.6.36) Designed to be very fast at mount time (even faster than UBIFS): O(1) mount time Supposed to consume less RAM than JFFS2 Ability to run on block devices but with poor performance 1

Logfs in action kernel BUG at fs/logfs/segment.c:858! Unable to handle kernel NULL pointer dereference at virtual address pgd = ced [] *pgd=8edbd31, *pte=, *ppte= Internal error: Oops: 817 [#1] last sysfs file: /sys/devices/virtual/vc/vcsa6/uevent Modules linked in: logfs zlib_deflate CPU: Tainted: G W (2.6.36 #2) PC is at bug+x1c/x28 LR is at bug+x18/x28 pc : [<c2b428>] lr : [<c2b424>] psr: 213 sp : cfb7fe38 ip : 928 fp : 8 r1: c58b2 r9 : 9 r8 : ffffffff r7 : cfb7fea4 r6 : 8 r5 : cf5cd58 r4 : c58b2 r3 : r2 : cfb7fe2c r1 : c2fd4b7 r : 2c Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 1c5387d Table: 8ed19 DAC: 15 Process umount (pid: 868, stack limit = xcfb7e2e8) Stack: (xcfb7fe38 to xcfb8) With Linux 2.6.36. fe2: bf122dc bf122ec Reported on the linux embedded ML 11

SquashFS http://squashfs.sourceforge.net/ Filesystem for block storage, so it doesn't support the MTD API. However, as it is read only, it works fine with mtdblock, as long as the flash chip doesn't have any bad blocks. You could use it for read only sections in your filesystem, but you cannot rely on it (bad blocks can always happen). 12

Benchmark hardware (1) Calao Systems USB A9263 AT91SAM9263 ARM CPU 64 MB RAM 256 MB flash 2 USB 2. host 1 USB device 1 Mbit Ethernet port Powered by USB! Serial and JTAG through this USB port. Multiple extension boards. Approximately 16 EUR Supported in mainstream Linux since version 2.6.27! 13

Benchmark hardware (2) TI Beagle Board TI OMAP 353 ARM CPU 256 MB RAM, 256 MB flash RS 232 serial USB Host USB OTG JTAG DVI D, S Video Audio In and Out MMC/SD Only 15 USD 14

Benchmark methodology Using a Debian Squeeze root filesystem for armel. Supports armv4 (Ubuntu on arm only supports v7) Contains all the tools to manipulate flash, as well as utilities for each filesystem. Using automated scripts supporting multiple boards Take care of sending commands to the boards through a serial line. Test rootfs and GPL scripts available on http://free electrons.com/pub/utils/board automation/ 15

Initialization tests Time to load the filesystem drivers Special case of UBIFS: ubi module initialization ubiattach time module loading time 16

Initialization benchmarks Time 1.5 CALAO Board 1.5 5 1 15 2 25 3 Time Partition size.3.25.2.15.1.5 Beagle Board 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 17

issue on Beagle Methodology: ubiattach, mount, file, detach, attach again... oops No problem on Calao!... UBI error: ubi_io_read: error 74 (ECC error) while reading 64 bytes from PEB 53:, read 64 bytes UBI error: ubi_io_read: error 74 (ECC error) while reading 64 bytes from PEB 54:, read 64 bytes UBI error: ubi_io_read: error 74 (ECC error) while reading 64 bytes from PEB 62:, read 64 bytes UBI error: ubi_io_read: error 74 (ECC error) while reading 64 bytes from PEB 63:, read 64 bytes UBI warning: check_what_we_have: 29 PEBs are corrupted corrupted PEBs are: 3 4 8 1 11 13 14 15 18 2 21 23 24 25 29 33 34 35 36 38 39 4 41 44 5 51 53 62 63 UBI error: check_what_we_have: too many corrupted PEBs, refusing this device ubiattach: error!: cannot attach mtd1 18

mount time benchmarks 2.5 CALAO Board Time 2 1.5 1.5 5 1 15 2 25 3 Partition size 2 Beagle Board Time 1.5 1.5 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 19

Time init + mount time benchmarks 3 2.5 2 1.5 1.5 CALAO Board 5 1 15 2 25 3 Partition size 2 Beagle Board Time 1.5 1.5 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 2

RAM (KB) init + mount memory usage 3 25 2 15 1 5 CALAO Board 5 1 15 2 25 3 RAM (KB) Partition size 3 25 2 15 1 5 Beagle Board 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 21

Used space 25 CALAO Board Space (KB) 2 15 1 5 5 1 15 2 25 3 Space (KB) Partition size 12 1 8 6 4 2 Beagle Board 5 1 15 2 25 3 Partition size Note: data missing on Beagle (bug to investigate) 22

Read time benchmarks 5 CALAO Board Time 4 3 2 1 5 1 15 2 25 3 Partition size 4 Beagle Board Time 3 2 1 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 23

Remove time benchmarks 4 CALAO Board Time 3 2 1 5 1 15 2 25 3 Partition size 4 Beagle Board Time 3 2 1 5 1 15 2 25 3 Partition size Note: couldn't measure on Beagle (bug) 24

Write time benchmarks 5 CALAO Board Time 4 3 2 1 5 1 15 2 25 3 Time Partition size 12 1 8 6 4 2 Beagle Board 5 1 15 2 25 3 Partition size 25

Video write time benchmarks 5 CALAO Board Time 4 3 2 1 5 1 15 2 25 3 Time Partition size 12 1 8 6 4 2 Beagle Board 5 1 15 2 25 3 Partition size 26

Flash filesystem conclusions logfs Unusable so far. Crashes on both Beagle and Calao boards (2.6.36). Poor performance compared to the others. May only make sense on small partitions where space matters. Best choice for write performance. Good choice for small partitions when read/write performance and boot time matter more than space. Show get in mainline in the next months Good or best performance in medium and big partitions Time to replace your partitions by or by! 27

Future of MTD devices? Embedded MMC (emmc) starting to replace NAND flash Cheaper: ~3 EUR for 8 GB (Source: Calao Systems) Bad blocks managed internally No more issue with the bootloader sector going corrupt. Wear leveling could apply to the whole storage space (In theory, like with UBI. Not true with some devices). Automatic sleep mode Faster boot time: driver less initialization. Can take advantage of block filesystems with optimizations for SSDs. How reliable, trustworthy and resistant are these? Loosing control on wear leveling. 28

Quick block fs benchmarks Methodology Tests run on the Beagle board Copy 8 MB of rootfs files from USB to MMC Flush caches Read MMC contents Flush caches Remove MMC contents Write 1 copies of a 6 MB video to MMC 29

Disk usage after format 4 35 Space (MB) 3 25 2 15 1 5 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem 3

MMC copy from USB (ext3) 4 35 3 Time (s) 25 2 15 1 5 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem 31

MMC read time 18 16 14 Time (s) 12 1 8 6 4 2 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem 32

MMC remove time 7 6 Time (s) 5 4 3 2 1 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem jfs: 2872s! xfs: 239s! 33

MMC write video time 45 4 35 Time (s) 3 25 2 15 1 5 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem 34

MMC video write speed (MB/s) 8 7 6 MB/s 5 4 3 2 1 ext2 ext3 ext4 btrfs reiserfs jfs xfs vfat nilfs2 Filesystem 35

block storage: conclusions ext4 is great! Best compromise between maturity and performance. btrfs rocks! Though not production ready (still experimental). xfs is very disappointing (it has good performance on rotating disks) Hard to tell which filesystem will work best on your system. Make your own experiments (switching filesystems is cheap)! 36

Call for change Squashfs on top of UBI Too much overhead today SquashFS Block device on top of UBI MTD block Yaffs2 in mainline! Merge the Logfs Forum with the MTD Foundation ; ) MTD API UBI MTD driver Flash chip 37

Thanks! Questions? Comments? Scripts and test root filesystem on http://free electrons.com/pub/utils/board automation/ 38

Flash fs mini BOF Do you think that emmc will completely replace NAND flash? Would you feel comfortable to use block flash storage as a swap area? How do you limit the number of writes in a read/write partition? Any project you would like CELF to support? 39