File System Challenges in Consumer Electronics Products (Chan Gyun - - PowerPoint PPT Presentation

file system challenges in consumer electronics products
SMART_READER_LITE
LIVE PREVIEW

File System Challenges in Consumer Electronics Products (Chan Gyun - - PowerPoint PPT Presentation

File System Challenges in Consumer Electronics Products (Chan Gyun Jeong) SW Platform Lab., Corporate R&D LG Electronics, Inc. 2014/10/31 Contents LG webOS TV Overview File Systems in webOS TV Database in webOS TV


slide-1
SLIDE 1

File System Challenges in Consumer Electronics Products

정찬균 (Chan Gyun Jeong) SW Platform Lab., Corporate R&D LG Electronics, Inc. 2014/10/31

slide-2
SLIDE 2

1

Contents

  • LG webOS TV Overview
  • File Systems in webOS TV
  • Database in webOS TV
  • Squashfs Challenges and Improvements
  • File Truncation Performance
  • FUSE Overhead in Android
  • File System Patents Issue
  • eMMC Lifetime Issue
  • eMMC Performance Issues
  • Expectations for NVRAM
slide-3
SLIDE 3

2

LG webOS TV Overview

Linux Kernel

TV Web App (Javascript, HTML5) System UI Native Apps Web App (Javascript, HTML5)

Enyo Framework CP Engine

EPG

Volume +/-

Luna Bus

TV Service

(Watching, Recording, HDMI)

webOS Services 100+

( Media Server / node.js …)

  • Make TV Simple Again : 3S (Simple Switching/Connection/Discovery)

Simple Switching Simple Connection Simple Discovery

slide-4
SLIDE 4

3

File Systems in webOS TV

  • ext4 file system used for a

partition requiring writable file feature in runtime

  • e.g. LG App Store partition
  • Squashfs file system used for a partition

not requiring writable file feature in runtime

  • e.g. rootfs, TV Service partitions
  • Squashfs is a compressed read-only file

system, and provides high performance with low overhead & size reduction Fonts TV Service Root File System

  • Misc. Data
slide-5
SLIDE 5

4

Database in webOS TV

  • DB8 Database Service
  • Fast and light Key-Value based DB service
  • Data stored as JSON(Java Script Object Notation) objects in collections
  • No SQL support
  • Using LevelDB as backend
slide-6
SLIDE 6

5

Squashfs Challenges and Improvements (1)

  • Compression Algorithm Performance

Source: http://www.linuxjournal.com/node/8051/ LZO ZLIB

  • High decompression performance needed

for CE products rather than compression speed

  • LZO (Lempel-Ziv-Oberhumer) outperforms

ZLIB(aka. GZIP) in decompression performance

  • Squashfs LZO support contributed to

mainline Linux kernel by LG

  • LG contributed support for new LZ4

compression to mainline as well

  • LZ4 outperforms LZO when unaligned

memory access is enabled in ARM

  • Squashfs LZ4 ready to upstream into

mainline

134.4 88.9 Squashfs

  • Seq. Read

Throughput (MB/s) ZLIB LZO

slide-7
SLIDE 7

6

Squashfs Challenges and Improvements (2)

  • Single Decompressor Problem
  • Squashfs provides only one decompression stream buffer which incurs

single-threaded decompression for concurrent requests

  • Gives poor performance on parallel I/O workload of multicore systems
  • Additional memory copy needed due to internal buffer

Decompress Read Request 1 Read Request 2 Read Request 3 Internal Buffer Page Cache Read Request N

Bottleneck

slide-8
SLIDE 8

7

Squashfs Challenges and Improvements (3)

  • Multiple Decompressor Solution
  • Gives great performance for parallel I/O workloads on Multi-core systems
  • Eliminates a memory copy by directly decompressing into page cache
  • But requires more CPU and memory usage than single thread
  • LG submitted a patch set and made a contribution to mainline kernel

Decompress Read Request 1 Read Request 2 Read Request 3 Page Cache Read Request N Decompress Decompress Decompress

67.7 13.7 4 Concurrent

  • Seq. Read

Throughput (MB/s) Single Multiple

slide-9
SLIDE 9

8

File Truncation Performance

  • How about performance if we need to cut data in the middle of a video

file ?

  • Using normal file truncation works, but it takes very long time depending
  • n the video file size
  • We modified some kernel file systems to help file truncation performance

and split a large video into smaller files in DVR-enabled products

  • Recently, fallocate(FALLOC_FL_COLLAPSE_RANGE) feature merged

in mainline kernel

Cut Commercial

slide-10
SLIDE 10

9

FUSE Overhead in Android (1)

  • FUSE (File System In Userspace)
  • Let applications create their own file systems without modifying kernel code
  • Used to emulate external storage and ensure security in Android

VFS (Virtual File System) bionic-c sdcard service

(Userspace File System )

Applications

Userspace Kernel

EXT4

/dev/fuse /data/media

FUSE

/storage/sdcard0

1 3 2  Needs 3 memory copies for read() or write()  Could be overhead in some systems

slide-11
SLIDE 11

10

FUSE Overhead in Android (2)

  • Removes unnecessary memory copies by splice in Linux kernel

FUSE Applications EXT4 sdcard service

write() write() read()

memory copy memory copy memory copy

FUSE Applications EXT4 sdcard service

write()

memory copy

splice() memory zero copy

36 30

Improvement Rate (%)

  • Seq. Read
  • Seq. Write
slide-12
SLIDE 12

11

File System Patents Issue

  • BOM(Bill of Materials) cost is very important in CE products, BUT:
  • Even patents cost for file systems matters a lot !
  • SDXC includes M$’s exFAT file system as a mandatory feature
  • Eventually adopting open standard file systems will benefits

manufacturers and end users

Source: digitaltrends.com, unwiredview.com

Estimated Licensing Fee per Device (US$)

20 60

iPhone Android Phone

slide-13
SLIDE 13

12

eMMC Lifetime Issue

  • TV lifetime issue when using DVR(Digital Video Recording) function
  • Huge amount of writing data incurred by

DVR enabled workload

  • Even Timeshift (aka. Live Playback)

feature spec out for eMMC  e.g. 5.7 GB for daily workload with Full HD video (19.39 Mbps in Korea)

  • How to optimize WAF(Write Amplification

Factor) in file system and block device driver layer ?

  • How to improve eMMC lifetime in FTL ?

12.7 13.3 3.1 6.9 Lifetime (Years) 8GB MLC 16GB MLC 8GB TLC 16GB TLC

< Workload > 400min/Day including 30min Recoding

slide-14
SLIDE 14

13

eMMC Performance Issue

  • MLC vs TLC on Performance

270 90 170 50 100 10

  • Seq. Read (MB/s)
  • Seq. Write (MB/s)

16GB MLC(HS400) 16GB MLC(HS200) 8GB TLC(HS200)

  • Not much performance issues for MLC-

type eMMC flash memory

  • But performance lacks for TLC-type

eMMC in some workloads

  • Any chances to improve performance of

TLC-type eMMC ?

slide-15
SLIDE 15

14

Expectations for NVRAM

  • Workload aware or File System aware FTL
  • There are various workloads in smart phone and smart TV
  • How about FTL customization for per-partition workload ?
  • If FTL could handle I/O based on workload characteristic per-partition ?

 DVR partition : 4MB large sequential I/O and write priority  Database partition : 1 ~ 4KB small random I/O

  • Byte-addressable Persistent Memory
  • Cost Innovation
  • Mass Producibility
  • Performance

DRAM Flash

slide-16
SLIDE 16