lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: free idle swap cache page after COW
On Tue, Jun 01, 2021 at 01:31:43PM +0800, Huang Ying wrote:
> With commit 09854ba94c6a ("mm: do_wp_page() simplification"), after
> COW, the idle swap cache page (neither the page nor the corresponding
> swap entry is mapped by any process) will be left in the LRU list,
> even if it's in the active list or the head of the inactive list. So,
> the page reclaimer may take quite some overhead to reclaim these
> actually unused pages.
>
> To help the page reclaiming, in this patch, after COW, the idle swap
> cache page will be tried to be freed. To avoid to introduce much
> overhead to the hot COW code path,
>
> a) there's almost zero overhead for non-swap case via checking
> PageSwapCache() firstly.
>
> b) the page lock is acquired via trylock only.
>
> 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 23.8% with the decreased size of swap cache and
> swapin throughput.
>
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org> # use free_swap_cache()
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Rik van Riel <riel@surriel.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Dave Hansen <dave.hansen@intel.com>
> Cc: Tim Chen <tim.c.chen@intel.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

\
 
 \ /
  Last update: 2021-06-01 15:30    [W:0.168 / U:1.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site