lkml.org 
[lkml]   [2021]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: move idle swap cache pages to the tail of LRU after COW
From
Date
On Wed, 2021-05-19 at 09:33 +0800, Huang Ying wrote:

> To test the patch, we used pmbench memory accessing benchmark with
> working-set larger than available memory on a 2-socket Intel server
> with a NVMe SSD as swap device. Test results shows that the pmbench
> score increases up to 21.8% with the decreased size of swap cache and
> swapin throughput.

Nice!

> +++ b/mm/memory.c
> @@ -3012,6 +3012,11 @@ static vm_fault_t wp_page_copy(struct vm_fault
> *vmf)
> munlock_vma_page(old_page);
> unlock_page(old_page);
> }
> + if (page_copied && PageSwapCache(old_page) &&
> + !page_mapped(old_page) && trylock_page(old_page)) {
> + try_to_free_idle_swapcache(old_page);
> + unlock_page(old_page);
> + }

That's quite the if condition!

Would it make sense to move some of the tests, as well
as the trylock and unlock into try_to_free_idle_swapcache()
itself?

Especially considering that page_mapped is already tested
in that function, too...

> put_page(old_page);
> }



--
All Rights Reversed.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-05-19 04:13    [W:0.083 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site