[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZfreCicoK9C6GW1t@casper.infradead.org>
Date: Wed, 20 Mar 2024 13:00:58 +0000
From: Matthew Wilcox <willy@...radead.org>
To: alexs@...nel.org
Cc: Izik Eidus <izik.eidus@...ellosystems.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>, Chris Wright <chrisw@...s-sol.org>,
kasong@...cent.com, Andrew Morton <akpm@...ux-foundation.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 03/11] mm/ksm: use a folio in remove_stable_node
On Wed, Mar 20, 2024 at 03:40:39PM +0800, alexs@...nel.org wrote:
> @@ -1124,22 +1124,22 @@ static int remove_stable_node(struct ksm_stable_node *stable_node)
> * merge_across_nodes/max_page_sharing be switched.
> */
> err = -EBUSY;
> - if (!page_mapped(page)) {
> + if (!folio_mapped(folio)) {
> /*
> * The stable node did not yet appear stale to get_ksm_page(),
> - * since that allows for an unmapped ksm page to be recognized
> + * since that allows for an unmapped ksm folio to be recognized
> * right up until it is freed; but the node is safe to remove.
> - * This page might be in an LRU cache waiting to be freed,
> + * This folio might be in an LRU cache waiting to be freed,
> * or it might be PageSwapCache (perhaps under writeback),
s/PageSwapCache/in the swapcache/
> * or it might have been removed from swapcache a moment ago.
> */
> - set_page_stable_node(page, NULL);
> + set_page_stable_node(&folio->page, NULL);
Before this patch, introduce a folio_set_stable_node() (and convert the
one caller which already has a folio). I'd do it the other way around
from ksm_get_folio(); that is:
static inline void folio_set_stable_node(struct folio *folio,
struct ksm_stable_node *stable_node)
{
set_page_stable_node(&folio->page, stable_node);
}
and then we can merge the two later when there are no more calls to
set_page_stable_node().
Powered by blists - more mailing lists