[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZUFjAj8Liaa/Ijmm@casper.infradead.org>
Date: Tue, 31 Oct 2023 20:26:42 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Sourav Panda <souravpanda@...gle.com>
Cc: corbet@....net, gregkh@...uxfoundation.org, rafael@...nel.org,
akpm@...ux-foundation.org, mike.kravetz@...cle.com,
muchun.song@...ux.dev, rppt@...nel.org, david@...hat.com,
rdunlap@...radead.org, chenlinxuan@...ontech.com,
yang.yang29@....com.cn, tomas.mudrunka@...il.com,
bhelgaas@...gle.com, ivan@...udflare.com,
pasha.tatashin@...een.com, yosryahmed@...gle.com,
hannes@...xchg.org, shakeelb@...gle.com,
kirill.shutemov@...ux.intel.com, wangkefeng.wang@...wei.com,
adobriyan@...il.com, vbabka@...e.cz, Liam.Howlett@...cle.com,
surenb@...gle.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-mm@...ck.org, weixugc@...gle.com
Subject: Re: [PATCH v3 1/1] mm: report per-page metadata information
On Tue, Oct 31, 2023 at 10:44:59AM -0700, Sourav Panda wrote:
> +++ b/mm/hugetlb.c
> @@ -1790,6 +1790,10 @@ static void __update_and_free_hugetlb_folio(struct hstate *h,
> destroy_compound_gigantic_folio(folio, huge_page_order(h));
> free_gigantic_folio(folio, huge_page_order(h));
> } else {
> +#ifndef CONFIG_SPARSEMEM_VMEMMAP
> + __mod_node_page_state(NODE_DATA(page_to_nid(&folio->page)),
> + NR_PAGE_METADATA, -huge_page_order(h));
> +#endif
surely,
__node_stat_sub_folio(folio, NR_PAGE_METADATA)
> @@ -2175,7 +2179,9 @@ static struct folio *alloc_buddy_hugetlb_folio(struct hstate *h,
> __count_vm_event(HTLB_BUDDY_PGALLOC_FAIL);
> return NULL;
> }
> -
> +#ifndef CONFIG_SPARSEMEM_VMEMMAP
> + __mod_node_page_state(NODE_DATA(nid), NR_PAGE_METADATA, huge_page_order(h));
__node_stat_add_folio(folio, NR_PAGE_METADATA)
(create the folio first ...)
> + __mod_node_page_state(NODE_DATA(page_to_nid(page)),
> + NR_PAGE_METADATA, 1);
Are you allergic to page_pgdat()?
> @@ -1656,6 +1657,8 @@ static void __init alloc_node_mem_map(struct pglist_data *pgdat)
> panic("Failed to allocate %ld bytes for node %d memory map\n",
> size, pgdat->node_id);
> pgdat->node_mem_map = map + offset;
> + mod_node_early_perpage_metadata(pgdat->node_id,
> + PAGE_ALIGN(size) >> PAGE_SHIFT);
I swear I said to use DIV_ROUND_UP(). Yes, I did:
https://lore.kernel.org/linux-mm/ZS%2Fm1KRwTLkcJY8y@casper.infradead.org/
Why have you done something different and claimed I said to do it?
You've annoyed me now; I shan't review the rest of this.
Powered by blists - more mailing lists