Overview

Modern smartphones are getting increasingly feature rich and have the capability far beyond simply calling or texting. Many of applications have been developed for it and bring great user experience. Howerver, the richer functionality an application can provide, the more demanding it is on computing, memory and storage resources. Thus, large DRAM is required for high-performance smartphones. However, the more DRAM, it means the more energy consumption, leading to rise more pressure on battery lifetime.


Fortunately, swapping is an effective way to extend memory space by writing inactive pages to backing storage. However, due to the performance and endurance issues of mobile internal flash memory, swapping is disabled in mobile devices. Nowadays, with the development of emerging NVM technologies, NVMs are considered the most promising DRAM alternatives due to their attractive features, such as byte-addressable, high-density, low standby power, etc. Moreover, NVMs can provide near DRAM performance. Utilzing those attractive features of NVM, we proposed NVM-Swap, the NVM based high-performance and energy efficient swapping for smartphones.


NVM-Swap is an NVM (Non-Volatile Memory) based swapping for smartphones. In our architecture, NVM is attached to the memory bus, side by side with DRAM, and shares part of the physical address with it. Swap in and out are through the memory interface. Different from the hybrid approach, which treats NVM as main memory, we treat NVM as the swap space.


To remove unnecessary overheads, we propose Copy-on-Write Swap-in (COWS). For read-only requests, data are read directly from the NVM swap space without copying it back to DRAM. To address the endurance issue of NVM, we designed a heap based wear leveling algorithm, namely Heap-Wear. Experimental results show that Heap-Wear can evenly distribute writes to the whole NVM swap space.

Publications

NVM-Swap was developed by College of Computer Science of Chongqing University. This technique is described in the papers below. NVM-Swap is openly available under the GPL licence, please kindly cite the following papers if they are used in a publication.

  • Kan Zhong, Xiao Zhu, Tianzheng Wang, Dan Zhang, Xianlu Luo, Duo Liu, Weichen Liu and Edwin Sha, DR. Swap: energy-efficient paging for smartphones, In Processdings of the 2014 International Symposium on Low Power Electronics and Design (ISLPED 2014) [BibTex] [Paper link]

  • Kan Zhong, Tianzheng Wang, Xiao Zhu, Linbo Long, Duo Liu, Weichen Liu, Zili Shao and Edwin Sha, Building High-Performance Smartphones via Non-Volatile Memory: The Swap Approach, In Processdings of the 14th ACM International Conference on Embedded Software (EMSOFT 2014) [BibTex] [Paper link] [Slides]
  • Kernel Code & Tool

    NVM-Swap is implemented into Android's Linux kernel (version 3.4). NVM-Swap is evaluated based on Google Nexus 5 smartphone. Just search the Internet how to compile and install kernel for Nexus 5. Here, we provide the customized kernel with NVM-Swap and the tool to enabled NVM-Swap. Note that the customized Linux kernel is distributed under the GPL licence, anyone has the right to modify and re-distribute it.

  • In current implementation, a portion of DRAM is employed to simulate NVM. Note that this kernel only provides a prototype of NVM-Swap, there still exits some problems need to be explored. We will continue to update this tool in the future. The customized kernel source code is available at here. You can download the source code use git clone command: git clone https://bitbucket.org/nvm-swap/nvm-swap-kernel.git

  • You can activate the NVM based swap area use the tool provide at here. First uncompress the downloaded file and copy the tool to your device, then type memswapon nvmswap -x 20000 to activate the NVM based swap space. You can check the source code for more details about this tool.
  • People

    Duo Liu (Faculty)
    College of Computer Science, Chongqing University, China
    Email:
    Homepage:
    http://www.cs.cqu.edu.cn/public/tindex/T0006

    Kan Zhong
    College of Computer Science, Chongqing University, China
    Email:

    Tianzheng Wang
    Department of Computer Science, University of Toronto, Canada
    Email:
    Homepage: http://www.cs.utoronto.ca/~tzwang

    Xiao Zhu
    College of Computer Science, Chongqing University, China
    Email:

    Linbo Long
    College of Computer Science, Chongqing University, China
    Email:

    Maintained by:

    Kan Zhong (kzhong1991@cqu.edu.cn)