Skip to contentSkip to conversation

Optimizations for swap sub-system

LSF/MM TOPIC Tim Chen 1 participant 1 message Jan 6, 2017 Memory management

lore
Share & tools
lore

Tim Chen

author
#0 lore raw

We have some swap related topics we'll like to discuss at mm summit. A We'll like to get everyone's opinionsA to guide future swap related work that we have in mind.

1. DAX swap -A
For swap space on very fast solid state block devices, the swappedA pages can be accessed directly using DAX mechanism withoutA incurring the overhead to allocate a page in RAM and swap themA in.A A The direct access swap space should speed things up inA many cases.A A One remaining issue is if the pages are accessedA frequently, we may still need to promote them back to RAM.A A Wea??llA like to discuss several possible approaches and their pros andA cons to see what is the most viable:A

A  (i) Using performance monitoring unit to measure the access frequencyA 
A  (ii) Extend the LRU list to such DAX swap spaceA 
A  (iii) A page scanning daemon

2. Improving Swap Read Ahead -A
The current swap read ahead is done in the same order that theA pages are swapped out.A A However, the order of page access mayA have no relations with the order that the pages are accessed,A especially for sequential memory access.A A Wea??ll like to discussA detection mechanism for sequential memory access and using a VMAA based read ahead for such case.

3. Improving Swap out path -A
Optimization of the swap out paths by reducing the contentionsA on the locks on swap device, radix tree by introducing finerA grained lock on cluster, splitting up the radix tree and gettingA swap pages and releasing swap pages in batches. A We'll like to address any issues if our proposed patchset has not been merged by the time of mm summit.

4. Huge Page Swapping -A
Now, the transparent huge page (THP) will be split before swappingA out and collapsed back to THP after swapping in.A A This will wasteA CPU cycles and reduce effectiveness (utilization) of THP.A A To resolveA these issue, we propose to avoid splitting THP during swap out/in.A A At the same time, this give us the opportunity to further optimizeA the performance of THP swap out/in with large read/write size andA reduced TLB flushing etc. to take advantage of the new high speedA storage device.

Thanks.

Ying Huang & Tim Chen

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>