Quasi-NVRAM in Android and Apple devices

Quasi-NVRAM in Android and Apple devices

Summary: You still hear complaints about nonremovable batteries in mobile devices – mostly Apple – but there is an upside: the ability to eliminate performance overhead. Here's how.

SHARE:
9

Three researchers, Hao Luo, Lei Tian and Hong Jiang of the University of Nebraska, asked a simple and seemingly obvious question. Since our mobile devices have non-removable batteries why don't we treat DRAM as if it were nonvolatile?

Their paper, qNVRAM: quasi Non-Volatile RAM for Low Overhead Persistency Enforcement in Smartphones was presented at the Usenix HotStorage conference last month.

Background

Typically Android mobile devices rely on SQLite, a shared preference key value store or the filesystem API to save persistent data on local flash. These employ journaling or file-level double-writes to ensure persistency.

The problem is that these techniques require multiple writes to storage, incurring substantial system overhead in devices that are already performance and power constrained.

For example, they found that more than 75 percent of Twitter data was written for persistency reasons. Looking at a group of common mobile apps they found that anywhere from 37 percent to 78 percent of the data writes were for atomicity. From the paper:

cost_of_persistency
Courtesy the authors.

Furthermore, it turns out that Android kernel reliability — where these data structures reside — is quite good, based on bug fixes and user support calls. They analyzed Android issue reports and found that only 10 reports or 0.05 percent of all 19,670 reported issues related to Android defects with unexpected or random power-off. That implies a small chance that unexpected power failure may occur.

The test

The researchers constructed a prototype test system with the with several innovations.

  • Quasi-NVRAM. They set aside a portion of system DRAM to act as a battery backed up nonvolatile DRAM.
  • Device driver. A new device driver and library that manage I/O between the qNVRAM and system flash memory.
  • Persistent Page Cache. A new data structure in SQLite using quasi-NVRAM to perform in-place updates to the database files. 
  • Relaxed data flushing. Absorbs repeated writes to table files to further reduce I/O.

Results

Implemented on an Android smartphone they found that

"...qNVRAM speeds up the insert, update and delete transactions by up to 16.33x, 15.86x and 15.76x respectively."

Furthermore, the amount of data committed to flash was reduced by about 40 percent. Given how common constant feed updates are on mobile devices, this is a significant result.

The Storage Bits take 

Some are miffed that many smartphones don't have easily removable batteries. This research shows the upside of such designs: all DRAM can be treated as NVRAM whether on Android or Apple's iOS.

Note that qNVRAM can't replace flash. DRAM is more power-hungry and costly than flash.

But research shows that by reducing the I/O overhead of the system with qNVRAM, significant gains in performance — and presumably battery life — can be achieved at very little cost. It also simplifies the problem of extending flash endurance.

It was obvious five years ago with the advent of non-removable batteries on phones and notebooks that engineers could take a new look at achieving persistency. Congratulations to the researchers for taking a rigorous approach to the problem.

Comments welcome, as always. What problems do you see with qNVRAM?

Topics: Storage, Android, Apple, Hardware, iOS

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

9 comments
Log in or register to join the discussion
  • The only actual reason

    The only actual reason to have a glued in battery is a shiny metal case and a limited lifespan.
    Buster Friendly
    • Well ...

      I'm glad someone has all the answers :)
      harvey_rabbit
    • More reasons...

      A non-removable battery can be significantly larger than a removable battery, because no space is taken up by the bulky battery connectors. Most people don't want to be bothered with carrying extra batteries, extra SD cards, and/or chargers everywhere they go. They prefer to have everything built-in and for it to offer higher capacity. If removable batteries and storage were really that important to people, the iPhone wouldn't still be the top selling smartphone model from any manufacturer in the world. Ask anyone whether they would rather have to carry two batteries or a built-in battery that lasts longer.
      BillDem
      • iPhone is the top selling smartphone ???

        I don't much care which technology I use, as long as it meets my needs. But wow, do I ever disagree with BillDem. I'm dead against paying iPrices for an additional 32 or 64GB when everyone else charges much less. And as for the iPhone being the top selling, it turns out that Samsung sold 85 million phones in the first quarter of 2014 (good for a 30% market share), compared to Apple's 43.7 million phones (15.5% market share - actually down from 17.1% in the same quarter last year).

        http://www.crn.com/slide-shows/mobility/300072681/the-five-best-selling-smartphone-brands-of-the-first-quarter.htm/pgno/0/4

        I hate it when all fanboys make stupid claims without merit or real world metrics.

        As for batteries, we all know that batteries get worse as they age. Being able to change a battery could make the phone hardware last a lot longer than the vendors prefer. Cheap solution to offset being forced to upgrade.
        CanuckHockeyCoach
      • internal battery connectors

        The battery connector in your typical iphone is just as big as any battery connector for removable batteries.
        Have you seen the inside of a 4/4S? There is a gap right around the battery. Enough for a 2mm battery wall right around it.
        This excuse about battery space is bullsh17.
        warboat
  • Overall performance gain?

    So they found that the SQLite transaction speed improved about 16x (= 1500%).
    But how much would the overall performance improve?
    pj.de.bruin
  • Why even call it Quasi NVRAM?

    It's either NVRAM or it's not.
    Just call it battery backed RAM, like it has been called for decades.
    It's dynamic, needs power to refresh, and it's volatile.
    No need for the quasi bullsh17 misnomers just because it's a phone.
    warboat
  • I see one disadvantage.

    If the battery is allowed to discharge completely, the "non-volatile" data is lost. The same thing happens at end of battery life, when it will no longer hold a charge. How critical is this data? Is it critical enough that losing it would make the processor unable to process any input that could conceivably restore it? If so, it would make more sense to put it in flash memory (possibly in the SSD that is already present) as a checkpoint.

    Desktop and laptop PCs keep rarely changed configuration options, and the real time clock, in a CMOS based STATIC RAM, which requires only battery VOLTAGE to retain data and consumes POWER only during bit changes. This memory is kept alive, and the clock is kept running, by a miniature watch battery on the motherboard, separate from the main power supply. And even though that battery can last beyond the OBSOLESCENCE lifetime of the computer, it is replaceable. Keeping a MORE permanent copy of how the computer's configuration differs from the factory defaults is the owner's responsibility.
    jallan32
    • Non-essential

      This is non-essential data used by applications on the device. Losing won't kill your system but it will extend your SSD's lifetime. The point is to use the SSD less wastefully.
      2mnyzs