Do we still need skip swapcache logic in do_swap_page() for SWP_SYNCHRONOUS_IO?
Hi, Minchan,
In commit 0bcac06f27d7 ("mm, swap: skip swapcache for swapin of synchronous device"), swap cache management is skipped for super fast device with synchronous IO. That did help performance for these devices much at that time. But in commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU"), swap cache is used to record workingset shadow value. So it needs to be operated anyway in swapin in common cases. Although lockless operation get_shadow_from_swap_cache() is used now, in swap_free() path, swap cache will be locked. So now, is it still necessary to skip swap cache logic in do_swap_page() for SWP_SYNCHRONOUS_IO? Maybe we can just simplify the logic?
Best Regards,
Huang, Ying
Hi Huang,
Quoted 12 lines · Ying
Hi, Minchan,
In commit
0bcac06f27d7("mm, swap: skip swapcache for swapin of synchronous device"), swap cache management is skipped for super fast device with synchronous IO. That did help performance for these devices much at that time. But in commitaae466b0052e("mm/swap: implement workingset detection for anonymous LRU"), swap cache is used to record workingset shadow value. So it needs to be operated anyway in swapin in common cases. Although lockless operationget_shadow_from_swap_cache()is used now, inswap_free()path, swap cache will be locked. So now, is it still necessary to skip swap cache logic indo_swap_page()forSWP_SYNCHRONOUS_IO? Maybe we can just simplify the logic?
Since we have xarray and better swap management(I believe) since then, could you try to measure swap-in performance?
If the gain is negligible today, we definitely could drop it.
Thank you.