Differentiating Cache Files for Fine-grain Management to Improve Mobile Performance and Lifetime

Yu Liang, Jinheng Li, Xianzhang Chen, Rachata Ausavarungnirun, Riwei Pan, Tei-Wei Kuo, Chun Jason XueHotStorage 2020 · OpenReview

TL;DR

Mobile devices are drowning in cache files, impacting performance and battery life. This paper proposes a novel "Fine-grain Cache File Management" (FCFM) system that intelligently categorizes cache files into "burn-after-reading," "transient," and "long-living" types. By storing frequently accessed files in faster memory and less critical ones more efficiently, FCFM significantly reduces write operations to flash storage, boosting both device speed and longevity.

What Problem Does This Paper Address?

Modern smartphones are packed with apps that constantly download and store data as cache files to speed up future access. While this is intended to improve user experience, the sheer volume of these cache files, especially from apps like social media and video streaming, leads to a massive number of write operations to the device's flash storage. These frequent writes not only degrade the overall I/O performance, making the device feel sluggish, but also significantly shorten the lifespan of the flash storage itself, a critical component of mobile devices. Existing systems treat all cache files equally, failing to leverage the fact that not all cached data is equally important or frequently accessed. This paper tackles the problem of inefficient cache management by proposing a system that differentiates cache files based on their access patterns to optimize performance and extend device lifetime.

Methods

The core of this paper's contribution is the Fine-grain Cache File Management (FCFM) framework. FCFM introduces a "filter" mechanism to categorize cache files into three distinct types:

  • Burn-After-Reading (BAR): These files have a high write volume but very little subsequent read activity. Once an application closes a BAR file, FCFM discards it, assuming it won't be needed again. This is expected to have minimal impact on performance as they are rarely re-accessed.
  • Transient: These files have a significant write and read volume but a short active period. FCFM stores these in main memory using an in-memory file system. When memory runs low, BAR files are discarded first, followed by transient files using an LRU (Least Recently Used) eviction policy.
  • Long-living: These are files with high read volume and a long active period. FCFM stores these in the flash storage, similar to existing systems, to ensure fast re-access.

The framework utilizes a hybrid architecture combining an in-memory file system (like RAMFS) for BAR and transient files with a traditional flash file system (like F2FS) for long-living files.

Datasets

The paper's analysis is based on tracing cache file accesses from ten commonly-used Android applications, including social media (Facebook, Twitter), map apps (Map, Earth), games (CandyCrush, Zombie), video apps (YouTube, TikTok), and browsers (Chrome, Firefox). The evaluation of the FCFM framework specifically uses YouTube's video cache files, which constitute about 93% of its total cache.

Key Insights and Ideas

  • Cache files are not created equal: The assumption that all cached data is valuable for future access is fundamentally flawed. Different applications and even different files within the same application exhibit vastly different access patterns.
  • Write-heavy nature of mobile caching: On average, write operations to cache files are significantly more numerous than read operations, highlighting the performance and lifetime burden.
  • Long-living files are key for reads: A disproportionately large percentage of read operations are concentrated on a small subset of cache files that tend to have longer lifetimes.
  • BAR files are prime candidates for eviction: A significant portion of cache files are written once and never read again, making them ideal candidates for immediate discarding.
  • Intelligent placement matters: By strategically placing cache files in either fast memory or slower flash storage based on their predicted usage, substantial improvements in performance and device longevity can be achieved.

Key Results

The evaluation using YouTube's video cache files demonstrated the effectiveness of FCFM:

  • Write amount reduction: FCFM reduced the total write amount to flash storage by 66% compared to a fully-in-memory approach and a remarkable 93% compared to the existing fully-in-flash mechanism.
  • Write count reduction: The number of writes to flash storage was reduced by 65% and 70% compared to fully-in-memory and fully-in-flash mechanisms, respectively.
  • Minimal penalty: Only about 2% of video cache data needed to be re-downloaded from the network due to FCFM's discarding strategy, indicating a very small penalty for the significant gains.

Limitations and Future Work

  • Categorization accuracy: The paper acknowledges that the accuracy of the FCFM filter is crucial. An incorrect classification could lead to performance penalties. Future work could explore more sophisticated methods for file categorization, potentially by analyzing file extensions (e.g., .exo files from YouTube are often BAR) or using machine learning models.
  • RAM allocation: Determining the optimal amount of RAM to allocate for the in-memory file system is a trade-off. Too little RAM limits the effectiveness of FCFM, while too much can starve other applications. The paper suggests that application-specific maximum cache sizes (like YouTube's 250MB for exo folder) could be leveraged.
  • Eviction scheme: While LRU is used for transient files, the paper suggests that a file-based eviction scheme, considering read patterns, file size, and lifetime, would be more suitable than page-based eviction for cache files.

The authors believe that FCFM offers a promising direction for improving mobile device performance and lifetime by moving beyond a one-size-fits-all approach to cache management.

Summary updated

BibTeX
@inproceedings{liang2020differentiating,
  author = {Yu Liang and Jinheng Li and Xianzhang Chen and Rachata Ausavarungnirun and Riwei Pan and Tei-Wei Kuo and Chun Jason Xue},
  title = {{Differentiating Cache Files for Fine-grain Management to Improve Mobile Performance and Lifetime}},
  booktitle = {HotStorage},
  year = {2020},
  url = {https://openreview.net/forum?id=iMffDpOt87},
}
Figure