Swap tables, flash-friendly swap, swap_ops, and more
4 days ago
- #Linux Kernel
- #Memory Management
- #Swap Subsystem
- Kairui Song presented recent and upcoming swap subsystem changes, reducing overhead from 3-11 bytes per page to 2-10 bytes, with a goal of zero static overhead and eventually capping at 3 bytes.
- Improvements include bypassing the swap cache, folio-based operations, lockless optimizations, unified folio allocation, and better swap cache utilization with enhanced readahead support.
- Issues discussed: swapping delays causing overshoot, inefficient huge page swapping, hibernation page waste, resizing swap areas, conflicts between anonymous and shmfs folios, and potential swap table compaction.
- Song proposed a 'swap mappings' concept with a virtual swap layer for abstraction, improving device removal and defragmentation, as shown in an RFC patch set.
- Youngjun Park addressed flash-friendly swapping to reduce wear on solid-state devices via sequential writes, deduplication, and hibernation integration, though code upstreaming challenges exist.
- Baoquan He (via Chris Li) introduced swap_ops to abstract swap backends, enabling modular customization similar to VFS, with potential for zram optimization and compressed I/O support.