Re: [PATCH v3 14/14] mm/ksm: remove set_page_stable_node

From: David Hildenbrand
Date: Fri Apr 05 2024 - 03:33:15 EST


On 25.03.24 13:49, alexs@xxxxxxxxxx wrote:
From: "Alex Shi (tencent)" <alexs@xxxxxxxxxx>

Remove the func since all caller are gone. Also remove the
VM_BUG_ON_PAGE() because it's not applicable for a folio.

Ehm, it is for small folios that we are working with here.

Please keep that check and convert it into a warn.

VM_WARN_ON_FOLIO(folio_test_anon(folio) && PageAnonExclusive(&folio->page), folio);

- page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
-}
-
static inline void folio_set_stable_node(struct folio *folio,
struct ksm_stable_node *stable_node)
{
- set_page_stable_node(&folio->page, stable_node);
+ folio->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
}
#ifdef CONFIG_SYSFS


--
Cheers,

David / dhildenb