I/O Stack Optimization for Smartphones

The Android I/O stack consists of elaborate and mature components (SQLite, the EXT4 filesystem, interrupt-driven I/O, and NAND-based storage) whose integrated behavior is not well-orchestrated, which leaves a substantial room for an improvement. We overhauled the block I/O behavior of five filesystems (EXT4, XFS, BTRFS, NILFS, and F2FS) under each of the five different journaling modes of SQLite. We found that the most significant inefficiency originates from the fact that filesystem journals the database journaling activity; we refer to this as the JOJ (Journaling of Journal) anomaly. The JOJ overhead compounds in EXT4 when the bulky EXT4 journaling activity is triggered by an fsync() call from SQLite. We propose (i) the elimination of unnecessary metadata journaling for the filesystem, (ii) external journaling and (iii) polling-based I/O to improve the I/O performance, primarily to improve the efficiency of filesystem journaling in the SQLite environment. We examined the performance trade-offs for each combination of the five database journaling modes, five filesystems and three optimization techniques. When we applied three optimization techniques in existing Android I/O stack, the SQLite performance (inserts/sec) improved by 130%. With the F2FS filesystem, WAL journaling mode (SQLite), and the combination of our optimization efforts, we improved the SQLite performance (inserts/sec) by 300%, from 39 ins/sec to 157 ins/sec, compared to the stock Android I/O stack.

[1]  Sang-Won Lee,et al.  SFS: random write considered harmful in solid state drives , 2012, FAST.

[2]  Khaled Salah,et al.  Implementation and experimental performance evaluation of a hybrid interrupt-handling scheme , 2009, Comput. Commun..

[3]  Alma Riska,et al.  Disk Drive Level Workload Characterization , 2006, USENIX Annual Technical Conference, General Track.

[4]  Deborah Estrin,et al.  Diversity in smartphone usage , 2010, MobiSys '10.

[5]  Frank Hady,et al.  When poll is better than interrupt , 2012, FAST.

[6]  Andrea C. Arpaci-Dusseau,et al.  Analysis and Evolution of Journaling File Systems , 2005, USENIX Annual Technical Conference, General Track.

[7]  Wei Hu,et al.  Scalability in the XFS File System , 1996, USENIX Annual Technical Conference.

[8]  Cristian Ungureanu,et al.  Revisiting storage for smartphones , 2012, TOS.

[9]  Young-Jin Kim,et al.  LAST: locality-aware sector translation for NAND flash memory-based storage systems , 2008, OPSR.

[10]  David Hung-Chang Du,et al.  Hot data identification for flash-based storage systems using multiple bloom filters , 2011, 2011 IEEE 27th Symposium on Mass Storage Systems and Technologies (MSST).

[11]  Youjip Won,et al.  AndroStep: Android Storage Performance Analysis Tool , 2013, Software Engineering.

[12]  Krishna Kant,et al.  Server Capacity Planning for Web Traffic Workload , 1999, IEEE Trans. Knowl. Data Eng..

[13]  Josef Bacik,et al.  BTRFS: The Linux B-Tree Filesystem , 2013, TOS.

[14]  Min Zhou,et al.  Analysis of personal computer workloads , 1999, MASCOTS '99. Proceedings of the Seventh International Symposium on Modeling, Analysis and Simulation of Computer and Telecommunication Systems.

[15]  Gernot Heiser,et al.  An Analysis of Power Consumption in a Smartphone , 2010, USENIX Annual Technical Conference.

[16]  Sang-Won Lee,et al.  Advances in flash memory SSD technology for enterprise database applications , 2009, SIGMOD Conference.

[17]  Youjip Won,et al.  Smart layers and dumb result: IO characterization of an android-based smartphone , 2012, EMSOFT '12.

[18]  Hojung Cha,et al.  AppScope: Application Energy Metering Framework for Android Smartphone Using Kernel Activity Monitoring , 2012, USENIX Annual Technical Conference.

[19]  Andrea C. Arpaci-Dusseau,et al.  A File Is Not a File: Understanding the I/O Behavior of Apple Desktop Applications , 2012, TOCS.

[20]  Carey L. Williamson,et al.  Internet Web servers: workload characterization and performance implications , 1997, TNET.

[21]  Umakishore Ramachandran,et al.  What is a good buffer cache replacement scheme for mobile flash storage? , 2012, SIGMETRICS '12.

[22]  Koji Sato,et al.  The Linux implementation of a log-structured file system , 2006, OPSR.

[23]  José M. García,et al.  The Design of New Journaling File Systems: The DualFS Case , 2007, IEEE Transactions on Computers.

[24]  Nicolas Christin,et al.  All Your Droid Are Belong to Us: A Survey of Current Android Attacks , 2011, WOOT.

[25]  John Wilkes,et al.  UNIX Disk Access Patterns , 1993, USENIX Winter.

[26]  Thomas E. Anderson,et al.  A Comparison of File System Workloads , 2000, USENIX Annual Technical Conference, General Track.