[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zfukmbwz.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Wed, 27 Mar 2024 14:22:36 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Kairui Song <ryncsn@...il.com>
Cc: linux-mm@...ck.org, Kairui Song <kasong@...cent.com>, Chris Li
<chrisl@...nel.org>, Minchan Kim <minchan@...nel.org>, Barry Song
<v-songbaohua@...o.com>, Ryan Roberts <ryan.roberts@....com>, Yu Zhao
<yuzhao@...gle.com>, SeongJae Park <sj@...nel.org>, David Hildenbrand
<david@...hat.com>, Yosry Ahmed <yosryahmed@...gle.com>, Johannes Weiner
<hannes@...xchg.org>, Matthew Wilcox <willy@...radead.org>, Nhat Pham
<nphamcs@...il.com>, Chengming Zhou <zhouchengming@...edance.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 10/10] mm/swap: optimize synchronous swapin
Kairui Song <ryncsn@...il.com> writes:
> From: Kairui Song <kasong@...cent.com>
>
> Interestingly the major performance overhead of synchronous is actually
> from the workingset nodes update, that's because synchronous swap in
If it's the major overhead, why not make it the first optimization?
> keeps adding single folios into a xa_node, making the node no longer
> a shadow node and have to be removed from shadow_nodes, then remove
> the folio very shortly and making the node a shadow node again,
> so it has to add back to the shadow_nodes.
The folio is removed only if should_try_to_free_swap() returns true?
> Mark synchronous swapin folio with a special bit in swap entry embedded
> in folio->swap, as we still have some usable bits there. Skip workingset
> node update on insertion of such folio because it will be removed very
> quickly, and will trigger the update ensuring the workingset info is
> eventual consensus.
Is this safe? Is it possible for the shadow node to be reclaimed after
the folio are added into node and before being removed?
If so, we may consider some other methods. Make shadow_nodes per-cpu?
> Test result of sequential swapin/out of 30G zero page on ZRAM:
>
> Before (us) After (us)
> Swapout: 33853883 33886008
> Swapin: 38336519 32465441 (+15.4%)
> Swapout (THP): 6814619 6899938
> Swapin (THP) : 38383367 33193479 (+13.6%)
>
[snip]
--
Best Regards,
Huang, Ying
Powered by blists - more mailing lists