Cellular Networks and Mobile Computing COMS 6998-10, Spring 2013 Instructor: Li Erran Li

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Introduction to Computers Lecture By K. Ezirim. What is a Computer? An electronic device –Desktops, Notebooks, Mobile Devices, Calculators etc. Require.
Paging: Design Issues. Readings r Silbershatz et al: ,
Introduction.  Professor  Adam Porter 
Introduction to Android Mohammad A. Gowayyed CS334-Spring 2014.
Objectives Overview Define an operating system
File Systems.
Click Here to Begin. Objectives Purchasing a PC can be a difficult process full of complex questions. This Computer Based Training Module will walk you.
By : Versha Thakur Shravani Aishwarya
Introduction CSCI 444/544 Operating Systems Fall 2008.
Energy Management in the Cinder Operating System
Cells: A Virtual Mobile Smartphone Architecture(2011)
Performance Analysis of Orb Rabin Karki and Thangam V. Seenivasan 1.
DEPARTMENT OF COMPUTER ENGINEERING
MobiDesk: Mobile Virtual Desktop Computing Ricardo A. Baratto, Shaya Potter, Gong Su, Jason Nieh Network Computing Laboratory Columbia University September.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Mobile Application Development
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Virtual Network Servers. What is a Server? 1. A software application that provides a specific one or more services to other computers  Example: Apache.
Introduction to Android Platform Overview
Case study 2 Android – Mobile OS.
To be Presented by, T.Sathishkumar [11mw07] 1. Synopsis Introduction Version Features License An Application Development Demo Possibilities Advantages.
Cellular Networks and Mobile Computing COMS , Fall 2012 Instructor: Li Erran Li
Cellular Networks and Mobile Computing COMS , Spring 2014 Instructor: Li Erran Li
Apps VS Mobile Websites Which is better?. Bizness Apps Survey Bizness Apps surveyed over 500 small business owners with both a mobile app and a mobile.
Android Introduction Platform Overview.
Programming mobile devices Part II Programming Symbian devices with Symbian C++
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
By Mihir Joshi Nikhil Dixit Limaye Pallavi Bhide Payal Godse.
Google Chromebook A New Way of Low Cost, Low Maintenance Computing.
Computer System Architectures Computer System Software
Computing Hardware Starter.
Virtualization Lab 3 – Virtualization Fall 2012 CSCI 6303 Principles of I.T.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
01. Introduction to Android Prof. Oum Saokosal Master of Engineering in Information Systems, South Korea
Types of Computers Mainframe/Server Two Dual-Core Intel ® Xeon ® Processors 5140 Multi user access Large amount of RAM ( 48GB) and Backing Storage Desktop.
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Explain the purpose of an operating system
GEOREMINDERS ANDROID APPLICATION BY: ADRIENNE KECK.
Android Husam Abdel Rahman. Introduction Android Operating system is most popular operating system these days with the advance in voice communications.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Chapter 2: Memory.
PC Computers or Desktop Computers: Usually a computer box or case with built In internal Hard Drive, Processor, power supply, and CD or DVD Rom hooked.
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
Full and Para Virtualization
Cloud Computing is a Nebulous Subject Or how I learned to love VDF on Amazon.
Chapter 9 Operating Systems Discovering Computers Technology in a World of Computers, Mobile Devices, and the Internet.
Mobile Application Development with ANDROID Umang Patel(6537) LDCE.
Power Guru: Implementing Smart Power Management on the Android Platform Written by Raef Mchaymech.
By Collin Donaldson.   In conventional OS architectures, the user accesses the OS via an account that has certain privileges (admin, guest). They can.
Android operating system N. Sravani M. Tech(CSE) (09251D5804)
By : Abhishek Verma Main Topics : 1. Introduction 2. Platform 3. Software Development 4. Overall Evaluation.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
How to Use an Android Tablet Well Come To You few Steps For How to Use an Android Tablet?
Application development process Part 1. Overview State of the mobile industry Size of the market Popularity of platforms How users use their devices Internationalisation.
Google. Android What is Android ? -Android is Linux Based OS -Designed for use on cell phones, e-readers, tablet PCs. -Android provides easy access to.
CS120 Purchasing a Computer
DISCOVERING COMPUTERS 2018 Digital Technology, Data, and Devices
Android Mobile Application Development
Classifying & evaluating computers
Operating System & Application Software
WELCOME Mobile Applications Testing
Architecture of Android
Android.
Overview Introduction VPS Understanding VPS Architecture
Chapter 4.
Application Development A Tutorial Driven Course
Classifying & evaluating computers
Department of Computer Science University of California, Santa Barbara
Presentation transcript:

Cellular Networks and Mobile Computing COMS , Spring 2013 Instructor: Li Erran Li Spring2013/ 2/19/2013: Smart phone virtualization and storage

Clarification on wakelock Not mutual-exclusion lock! Non-reference counted (similar to conditional variable) – acquire() wakes up the component – release() sets component free to sleep irrespective of number of acquire() Reference counted (similar to semaphore) – acquire() increments internal counter – release() decrements the counter – Component can sleep if internal counter reaches zer0 2/19/13 Cellular Networks and Mobile Computing (COMS )

Review of Previous Lecture What are the categories of ebugs? 2/19/13 Cellular Networks and Mobile Computing (COMS )

Ebug Taxonomy Ebug Hardware 23% Software 35% External 12% Unknown 30% OS Apps No Sleep Bug Loop Bug Immortality Bug External Service Network Signal Strength Wireless Handovers Courtesy: Pathak et al 4 Cellular Networks and Mobile Computing (COMS ) 2/12/13

Review of Previous Lecture (Cont’d) What are the types of no-sleep ebugs? How to detect no-sleep ebugs? 2/19/13 Cellular Networks and Mobile Computing (COMS )

Types of NoSleep Bugs and Detection 6 NoSleep Race Conditions NoSleep Code Paths NoSleep Dilations Cellular Networks and Mobile Computing (COMS ) Courtesy: Jindal et al 2/12/13 Static Data Flow Analysis Reaching Definitions Data Flow Problem

Review of Previous Lecture (Cont’d) How to build fine-grained power models? 2/19/13 Cellular Networks and Mobile Computing (COMS )

Finite-State-Machine (FSM) as Power Model Representation Use Finite-State-Machine (FSM) Nodes: Power states – Base State: No activity on phone – Productive state: Actual utilization – Tail state: No-useful work Edges: Transition rules – System calls (start/completion) – Workload (Ex: 50 pkts/sec) – Timeout State 1 State 2 State 3 Transitions Courtesy: Pathak et al 8 Cellular Networks and Mobile Computing (COMS ) 2/12/13

FSM Power Model Construction Systematic ‘Brute Force’ Approach – Step 1 : Model Single System Call – Step 2 : Model Multiple System Calls for Same Component – Step 3 : Model Multiple Components (Entire Phone) Requires domain knowledge – Semantics of system calls Courtesy: Pathak et al 9 Cellular Networks and Mobile Computing (COMS ) 2/12/13

Review of Previous Lecture (Cont’d) How to build an energy profiling tool such as Eprof? 2/19/13 Cellular Networks and Mobile Computing (COMS )

Energy Profiling Tracking power activities – System call based online power model Tracking app activities – IO: Backtrace system calls – CPU: Just like gprof [PLDI ‘82] Mapping power activities to app activities – Accounting Policy: Lingering Energy Consumption 11 Cellular Networks and Mobile Computing (COMS ) Courtesy: Pathak et al 2/12/13

Smart Phone Virtualization: on Servers/PCs Bluestacks (Demo) MegaDroid Off-the-shelf PCs emulates a town of 300,000 Android phones – Emulate cellular and GPS behavior Usage: – Tracing the wider effects of natural disasters – Hacking attempts – Software bugs – Assist real phone (e.g. offload computation, virus check) Video: sandia-labs-megadroid-project- simulates android-phones/ sandia-labs-megadroid-project- simulates android-phones/ 2/19/13 Cellular Networks and Mobile Computing (COMS )

Smart Phone Virtualization: on Devices Cells video: s s 2/19/13 Cellular Networks and Mobile Computing (COMS )

Personal Phone Business Phone Developer Phone Children ’ s Phone 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Virtualization 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Bare-Metal Hypervisor OS Kernel OS Kernel OS Kernel OS Kernel OS Kernel OS Kernel Hypervisor / VMM Hardware Server Virtualization poor device support / sharing 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

OS Host OS Kernel OS Hypervisor / VMM Hosted Hypervisor Desktop Virtualization kernel module kernel module Hardware host user space poor device performance poor device performance emulated devices emulated devices 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

OS Kernel User Space SDK Non-Virtualization no standard apps less secure no standard apps less secure custom user space API for isolated apps Hardware 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

device diversity mobile usage model ➡ graphics -accelerated UI device diversity mobile usage model ➡ graphics -accelerated UI Key Challenges PowerButtons WiFi GPS Cell Radio Framebuffer GPUBinder IPC TouchscreenAccelerometer Compasspmemmicrophoneheadsetspeakerscamera(s)h.264 accel. RTC / Alarms 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells microphone Key Observation large: lots of windows/apps small: one app at a time small: one app at a time 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells microphone Key Observation screen real-estate is limited, and mobile phone users are accustomed to interacting with one thing at time 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells microphone Usage Model foreground / background 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells microphone multiple, isolated virtual phones (VPs) on a single mobile device 100% device support in each VP ‣ unique phone numbers - single SIM! ‣ accelerated 3D graphics! multiple, isolated virtual phones (VPs) on a single mobile device 100% device support in each VP ‣ unique phone numbers - single SIM! ‣ accelerated 3D graphics! Complete Virtualization 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells microphone less than 2% overhead in runtime tests imperceptible switch time among VPs less than 2% overhead in runtime tests imperceptible switch time among VPs Efficient Virtualization 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel VP 3 VP 2 VP 1 Single Kernel: Multiple VPs virtualize at OS interface isolated collection of processes isolated collection of processes 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel Single Kernel: Device Support Power Cell Radio Binder IPC Accelerometer Compasspmemspeakerscamera(s)hw codec RTC / Alarms VP 3 VP 2 VP 1 Buttons WiFi GPS Framebuffer GPU Touchscreen microphoneheadset 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel Single Kernel: Device Support all VPs access the same device simultaneously VP 3 VP 2 VP 1 SensorsInputAndroid... Audio/Video RTC / Alarms WiFi Cell Radio Framebuffer PowerGPU 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel Power WiFi Cell Radio Framebuffer GPU RTC / Alarms SensorsInputAndroid... Audio/Video Device Namespaces safely, correctly multiplex access to devices device namespaces VP 3 VP 2 VP 1 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Cells 2/19/13 Cellular Networks and Mobile Computing (COMS ) ++ device namespaces foregroundforeground / background == Complete, Efficient, Transparent Mobile Virtualization Complete, Efficient, Transparent Mobile Virtualization Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel Power WiFi Cell Radio Framebuffer GPU RTC / Alarms SensorsInputAndroid... Audio/Video GPU Framebuffer device namespaces Cell Radio efficient basic graphics virtualization hardware accelerated graphics proprietary/closed interface 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

virtual addresses physical addresses screen memory Approach 1: Single Assignment Framebuffer 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Framebuffer virtual state screen memory Approach 2: Emulated Hardware emulated framebuffer 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

virtual addresses physical addresses mux_fb screen memory VP 3 background mux_fb presents identical device interface to all VPs using device namespaces mux_fb presents identical device interface to all VPs using device namespaces swap virt addr mappings: point to different phys addr swap virt addr mappings: point to different phys addr Cells: Device Namespaces VP 1 Framebuffer VP 2 background foreground 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

screen memory Accelerated Graphics MMU context VP 2 OpenGL VP 1 context OpenGL context VP 3 graphics virtual addresses physical addresses Framebuffer GPU VP: just a set of processes ! VP: just a set of processes ! process isolation 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

GPU MMU graphics virtual addresses physical addresses screen memory Device Namespace + Graphics Context context VP 2 OpenGL VP 1 context OpenGL context VP 3 background foreground background 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

2/19/13 Cellular Networks and Mobile Computing (COMS ) Linux Kernel Linux Kernel Drivers Baseband: GSM / CDMA RilD Vendor RIL VoIP VoIP? Courtesy: Jason Nieh et al.

Linux Kernel Linux Kernel GSM/CDMA RilD Dual-SIM? Vendor RIL GSM / CDMA Drivers RilD Vendor RIL 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Root Namespace Linux Kernel Linux Kernel vendor API Drivers Baseband: GSM / CDMA Cells RIL RilD VP 2 Cells RIL RilD VP 1 RilD Cells RIL VP 3 Cells: User-Level Namespace Proxy background foreground Vendor RIL proprietary hardware/software requires a well-defined interface. CellD 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Experimental Results Setup Nexus S five virtual phones 〈 Android 2.3 〉 overhead vs. stock 〈 Android 2.3 〉 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Experimental Results Setup 〈 Linpack 〉 CPU 〈 Linpack 〉 〈 Neocore 〉 graphics 〈 Neocore 〉 〈 Quadrant 〉 storage 〈 Quadrant 〉 〈 Sun Spider 〉 web browsing 〈 Sun Spider 〉 〈 Custom WiFi Test 〉 networking 〈 Custom WiFi Test 〉 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Runtime Overhead Negligible Overhead In 3D Measurements! Experimental Results Courtesy: Jason Nieh et al.

device namespaces ‣ safely and efficiently share devices foreground / background ‣ designed specifically for mobile devices implemented on Android less than 2% overhead on Nexus S device namespaces ‣ safely and efficiently share devices foreground / background ‣ designed specifically for mobile devices implemented on Android less than 2% overhead on Nexus S Cells Complete, Efficient, Transparent Mobile Virtualization Complete, Efficient, Transparent Mobile Virtualization 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

More Info cellrox.com cells.cs.columbia.edu 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Jason Nieh et al.

Revisiting Storage for Smartphones Hyojun KimCristian Ungureanu Nitin Agrawal 2/19/13 Cellular Networks and Mobile Computing (COMS )

Background blktrace: collect block level traces for device I/O monkeyrunner – installed at android-sdk-macosx/tools/monkeyrunner – functional testing framework for Interactive Android applications 2/19/13 Cellular Networks and Mobile Computing (COMS )

blktrace Block IO layer 2/19/13 Cellular Networks and Mobile Computing (COMS )

blktrace (Cont’d) 2/19/13 Cellular Networks and Mobile Computing (COMS ) Source: Alan D. Brunell E06apr_blktrace_brunelle_hp.pdf

blktrace (Cont’d) blktrace sample traces 2/19/13 Cellular Networks and Mobile Computing (COMS ) Source: Alan D. Brunell E06apr_blktrace_brunelle_hp.pdf

monkeyrunner Example code 1.# Imports the monkeyrunner modules used by this program 2.from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice 3.def main(): 4. # Connects to the current device, returning a MonkeyDevice object 5. device = MonkeyRunner.waitForConnection() 6. print 'waiting for connection...\n’ 7. package = 'coms6998.cs.columbia.edu’ 8. activity = 'coms6998.cs.columbia.edu.VoiceRegonitionDemoActivity' 9. # sets the name of the component to start 10. runComponent = package + '/' + activity 11. # Runs the component 12. device.startActivity(component=runComponent) 13. # Presses the speaker button 14. device.press(’DPAD_DOWN', MonkeyDevice.DOWN_AND_UP) device.press(’DPAD_CENTER', MonkeyDevice.DOWN_AND_UP) 15. # Takes a screenshot 16. screenshot = device.takeSnapshot() 17. # Writes the screenshot to a file 18. screenshot.writeToFile('./device1.png','png') 19. reference = MonkeyRunner.loadImageFromFile(./device.png') 20. if not screenshot.sameAs('./device.png', 0.9): 21. print "comparison failed!\n" 22.if __name__ == '__main__': 23. main() 2/19/13 Cellular Networks and Mobile Computing (COMS )

Life in the “Post-PC” Mobile Era Smartphone and tablet markets are huge & growing – 100 Million smartphones shipped in Q4 2010, 92 M PCs [IDC] – Out of 750 Million Facebook users, 250 Million (& growing) access through mobile; mobile users twice as active [FB] Innovation in mobile hardware: packing everything you need in your pocket – Blurring the phone/tablet divide: Samsung Galaxy Note – Hardware add-ons: NEC Medias (6.7mm thick, waterproof shell, TV tuner, NFC, HD camera,..) Manufacturers making it easier to replace PCs – Motorola Atrix dock converts a phone into laptop Mobile 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

2/19/13 Courtesy: Nitin Agrawal et al. Cellular Networks and Mobile Computing (COMS )

2/19/13 Courtesy: Nitin Agrawal et al. Cellular Networks and Mobile Computing (COMS )

Waiting is undesirable! Annoying for the user More time, more battery Easy to lose customers More so for interactive mobile users Aren’t network and CPU the real problem? Why are we talking about storage? 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Understanding Mobile Performance Network performance can impact user experience – 3G often considered the bottleneck for apps like browsing – Service providers heavily investing in 4G and beyond CPU and graphics performance crucial as well – Plenty of gaming, video, flash-player apps hungry for compute – Quad-core CPUs, GPUs to appear on mobile devices Does storage performance impact mobile experience? – For storage, vendors & consumers mostly refer to capacity Well understood! Not well understood! 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Wireless Network Throughput Progression Flash storage on mobile performs better than wireless networks Most apps are interactive; as long as performance exceeds that of the network, difficult for storage to be bottleneck Standard (theoretical) Mobile Flash a/g 3G Measured in Lab 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Introduction Why storage is a problem Android storage background and setup Experimental results Solutions Outline 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Why Storage is a Problem Performance for random I/O significantly worse than seq; inherent with flash storage Mobile flash storage classified into speed classes based on sequential throughput  Random write performance is orders of magnitude worse Vendor (16GB) Speed Class Cost US $ Seq Write Rand Write Transcend RiData Sandisk Kingston Wintec A-Data Patriot PNY Consumer-grade SD performance Performance MB/s However, we find that for several popular apps, substantial fraction of I/O is random writes (including web browsing!) Random versus Sequential Disparity 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Storage coming under increasingly more scrutiny in mobile usage – Random I/O performance has not kept pace with network improvements – n (600 Mbps peak) and ad (7 Gbps peak) offer potential for significantly faster network connectivity to mobile devices in the future Mobile Flash Rand Shifting Performance Bottlenecks Why Storage is a Problem Standard (theoretical) Mobile Flash Seq A/G 3G Measured in Lab 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Deconstructing Mobile App Performance Focus: understanding contribution of storage – How does storage subsystem impact performance of popular and common applications on mobile devices? – Performed analysis on Android for several popular apps Several interesting observations through measurements – Storage adversely affects performance of even interactive apps, including ones not thought of as storage I/O intensive – SD Speed Class not necessarily indicative of app performance – Higher total CPU consumption for same activity when using slower storage; points to potential problems with OS or apps Improving storage stack to improve mobile experience 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Introduction Why storage is a problem Android storage background and setup Experimental results Solutions Outline 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Storage Partitions on Android /system yaffs2 145MB read-only /cache yaffs2 95MB read write /data yaffs MB read write Internal NAND Flash Memory (512MB) /sdcard FAT32 16GB read write /misc 896KB settings /recovery rootfs 4MB alternate boot /boot rootfs 3.5MB kernel External SD PartitionFunction MiscH/W settings, persistent shared space between OS & bootloader RecoveryAlternative boot-into-recovery partition for advanced recovery BootEnables the phone to boot, includes the bootloader and kernel SystemContains the remaining OS, pre-installed system apps ; read-only CacheUsed to stage and apply “over the air” updates; holds system images DataStores user data (e.g., contacts, messages, settings) and installed apps; SQLite DB containing app data also stored here. Wiped on factory reset SdcardExternal SD card partition to store media, documents, backup files etc Sd-extNon-standard partition on SD card that can act as data partition 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Phone and Generic Experimental Setup Rooted and set up a Google Nexus One phone for development – GSM phone with a 1 GHz Qualcomm QSD8250 Snapdragon processor – 512 MB RAM, and 512 MB internal flash storage Setup dedicated wireless access point – b/g on a laptop for WiFi experiments Installed AOSP (Android Open Source Project) – Linux kernel modified to provide resource usage information 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Custom Experimental Setup Ability to compare app performance on different storage devices – Several apps heavily use the internal non-removable storage – To observe and measure all I/O activity, we modified Android’s init process to mount all internal partitions on SD card – Measurement study over the internal flash memory and 8 external SD cards, chosen 2 each from the different SD speed classes Observe effects of shifting bottlenecks w/ faster wireless networks – But, faster wireless networks not available on the phones of today – Reverse Tethering to emulate faster networks: lets the smartphone access the host computer’s internet connection through a wired link (miniUSB cable) Instrumentation to measure CPU, storage, memory, n/w utilization Setup not typical but allows running what-if scenarios with storage devices and networks of different performance characteristics Requirements beyond stock Android 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Apps and Experiments Performed WebBench Browser Visits 50 websites Based on WebKit Using HTTP proxy server App Install Top 10 apps on Market App Launch Games, Weather, YouTube GasBuddy, Gmail, Twitter, Books, Gallery, IMDB RLBench SQLite Synthetic SQL benchmark Facebook Android Google Maps Pulse News Reader Background Apps: Twitter, Books, Gmail Contacts, Picasa, Calendar Widgets: Pulse, YouTube, News, Weather, Calendar, Facebook, Market, Twitter 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Introduction Why storage is a problem Android storage background and setup Experimental results (talk focuses on runtime of apps) Paper has results on I/O activity, CPU, App Launch behavior, etc Solutions Outline 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

WebBench Results: Runtime Runtime on WiFi varies by 2000% between internal and Kingston Even with repeated experiments, with new cards across speed classes Even without considering Kingston, significant performance variation (~200%) Storage significantly affects app performance and consequently user experience With a faster network (USB in RT), variance was 222% (without Kingston) With 10X increase in N/W speed, hardly any difference in runtime Time taken for iPerf to download 100MB WiFi USB Time (s) 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

WebBench Results: Runtime Runtime on WiFi varies by 2000% between internal and Kingston Even with repeated experiments, with new cards across speed classes Even without considering Kingston, significant performance variation (~200%) Storage significantly affects app performance and consequently user experience With a faster network (USB in RT), variance was 222% (without Kingston) With 10X increase in N/W speed, hardly any difference in runtime Time taken for iPerf to download 100MB WiFi USB Time (s) 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Runtimes for Popular Apps (without Kingston) We find a similar trend for several popular apps Storage device performance important, better card  faster apps Apart from the benefits provided by selecting a good flash device, are there additional opportunities for improvement in storage? 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

WebBench: Sequential versus Random I/O Few reads, mostly at the start; significantly more writes About 2X more sequential writes than random writes Since rand is worse than seq by >> 2X, random dominates Apps write enough randomly to cause severe performance drop Paper has a table on I/O activity for other apps I/O Breakdown VendorSeq:Rand perf ratio Rand IOPS Transcend4302 Sandisk8179 RiData3955 Kingston Wintec A-Data Patriot PNY /19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

How Apps Use Storage? Exactly what makes web browsing slow on Android? – Key lies in understanding how apps use SQLite and FS interface /data/data/com.necla.webview lib (empty) cache webviewCache 6aaa3f00, 03051d8d, … many files (5.5MB) databases webview.db (14KB) webviewCache.db (129KB) These files written to SQLite in sync These files written to FS in write-behind WebBench Storage Schema  Apps typically store some data in FS (e.g., cache files) and some in a SQLite database (e.g., cache map) –All data through SQLite is written synchronously  slow! –Apps often use SQLite oblivious to performance effects 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

What-If Analysis for Solutions What is the potential for improvements? – E.g., if all data could be kept in RAM? – Analysis to answer hypothetical questions Placing Cache on Ramdisk does not improve perf. much DB on Ramdisk alone improves perf. significantly Both Cache and DB in RAM  no extra benefit Both Cache and DB on SD without sync recoups most perf A. Web Cache in RAM B. DB (SQLite) in RAM C. All in RAM D. All on SD w/ no-sync WebBench on RiData ABCD 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Implications of Experimental Analysis Storage stack affects mobile application performance – Depends on random v/s sequential I/O performance Key bottleneck is ``wimpy’’ storage on mobile devices – Performance can be much worse than laptops, desktops – Storage on mobile being used for desktop-like workloads Android exacerbates poor storage performance through synchronous SQLite interface – Apps use SQLite for functionality, not always needing reliability – SQLite write traffic is quite random  further slowdown! Apps use Android interfaces oblivious to performance – Browser writes cache map to SQLite; slows cache writes a lot 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Introduction Why storage is a problem Android storage background and setup Experimental results Solutions Outline 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

WebBench on RiData Pilot Solutions RAID-0 over SD card and internal flash – Leverage I/O parallelism already existent – Simple software RAID driver with striped I/O – As expected speedup, along with super linear speedup due to flash idiosyncrasies (in paper) Back to log-structured file systems – Using NilFS2 to store SQLite databases – Moderate benefit; suboptimal implementation Application-specific selective sync – Turn off sync for files that are deemed async per our analysis (e.g., WebCache Map DB) – Benefits depend on app semantics & structure PCM write buffer for flash cards – Store performance sensitive I/O (SQLite DB) – Small amount of PCM goes a long way PCM RAM RAID Base SelSync LogFS PCM RAM RAID Base SelSync LogFS 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Conclusion Contrary to conventional wisdom, storage does affect mobile application performance – Effects are pronounced for a variety of interactive apps! Pilot solutions hint at performance improvements – Small degree of application awareness leads to efficient solutions – Pave the way for robust, deployable solutions in the future Storage subsystem on mobile devices needs a fresh look – Have taken the first steps, plenty of exciting research ahead! – E.g., poor storage can consume excessive CPU; potential to improve energy consumption through better storage 2/19/13 Cellular Networks and Mobile Computing (COMS ) Courtesy: Nitin Agrawal et al.

Questions? 2/19/13 Cellular Networks and Mobile Computing (COMS )