Re: [PATCH] s390/mm: Add missing ctor/dtor on page table upgrade
From: Heiko Carstens
Date: Fri Jan 24 2025 - 04:40:12 EST
On Fri, Jan 24, 2025 at 10:29:17AM +0100, Heiko Carstens wrote:
> On Fri, Jan 24, 2025 at 08:58:07AM +0100, Kevin Brodsky wrote:
> In addition, looking at [1] where page table accounting was introduced: it
> is really meant to reflect the memory consumption used by page tables. This
> might work for nearly all architectures which have the same page table size
> for every level; but on s390 the lowest level comes with 4kb page tables
> while all other levels come with 16kb page tables.
>
> Therefore at least on s390 you really can't tell how much memory is
> consumed by page tables by only looking at nr_page_table_pages. It _might_
> make sense to introduce a factor of four for page table accounting for
> higher levels, so those numbers make at least some sense; but not sure
> about that.
Ah, this is actually not true at all, since we have
static inline void __lruvec_stat_add_folio(struct folio *folio,
enum node_stat_item idx)
{
__lruvec_stat_mod_folio(folio, idx, folio_nr_pages(folio));
}
which will do exactly what we want. So this part is not a problem.