From: Sourav Panda <souravpanda@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: corbet@lwn.net, gregkh@linuxfoundation.org, rafael@kernel.org,
akpm@linux-foundation.org, mike.kravetz@oracle.com,
muchun.song@linux.dev, rppt@kernel.org, david@redhat.com,
rdunlap@infradead.org, chenlinxuan@uniontech.com,
yang.yang29@zte.com.cn, tomas.mudrunka@gmail.com,
bhelgaas@google.com, ivan@cloudflare.com,
pasha.tatashin@soleen.com, yosryahmed@google.com,
hannes@cmpxchg.org, shakeelb@google.com,
kirill.shutemov@linux.intel.com, wangkefeng.wang@huawei.com,
adobriyan@gmail.com, vbabka@suse.cz, Liam.Howlett@oracle.com,
surenb@google.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v1 1/1] mm: report per-page metadata information
Date: Thu, 14 Sep 2023 14:04:22 -0700 [thread overview]
Message-ID: <CANruzcTYgSHmbYD=uMXuDokOFar+dVHkY1Mm-7BKr7xYW654GQ@mail.gmail.com> (raw)
In-Reply-To: <ZQH3tHbz2ghsyqHG@casper.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2784 bytes --]
Hi Matthew Wilcox,
Thank you very much for reviewing my patch. Please find my responses below.
On Wed, Sep 13, 2023 at 10:56 AM Matthew Wilcox <willy@infradead.org> wrote:
> On Wed, Sep 13, 2023 at 10:30:00AM -0700, Sourav Panda wrote:
> > @@ -387,8 +390,12 @@ static int alloc_vmemmap_page_list(unsigned long
> start, unsigned long end,
> >
> > while (nr_pages--) {
> > page = alloc_pages_node(nid, gfp_mask, 0);
> > - if (!page)
> > + if (!page) {
> > goto out;
> > + } else {
> > + __mod_node_page_state(NODE_DATA(page_to_nid(page)),
> > + NR_PAGE_METADATA, 1);
> > + }
> > list_add_tail(&page->lru, list);
>
> What a strange way of writing this. Why not simply:
>
> if (!page)
> goto out;
> + __mod_node_page_state(NODE_DATA(page_to_nid(page)),
> + NR_PAGE_METADATA, 1);
> list_add_tail(&page->lru, list);
>
Thank you Matthew Wilcox for your comment. I agree with you and will make
the corresponding change.
>
> > @@ -314,6 +319,10 @@ static void free_page_ext(void *addr)
> > BUG_ON(PageReserved(page));
> > kmemleak_free(addr);
> > free_pages_exact(addr, table_size);
> > +
> > + __mod_node_page_state(NODE_DATA(page_to_nid(page)),
> NR_PAGE_METADATA,
> > + (long)-1 * (PAGE_ALIGN(table_size)
> >> PAGE_SHIFT));
>
> Why not spell that as "-1L"?
>
> And while I'm asking questions, why NODE_DATA(page_to_nid(page)) instead
> of page_pgdat(page)?
>
Yes, thank you! I shall make both the suggested changes.
>
> > @@ -2274,4 +2275,24 @@ static int __init extfrag_debug_init(void)
> > }
> >
> > module_init(extfrag_debug_init);
> > +
> > +// Page metadata size (struct page and page_ext) in pages
>
> Don't use // comments.
>
Thank you. I shall replace them with /* text */ to be uniform with the
document.
>
> > +void __init writeout_early_perpage_metadata(void)
>
> "writeout" is something swap does. I'm sure this has a better name,
> though I can't think what it might be.
>
> > +{
> > + int nid;
> > + struct pglist_data *pgdat;
> > +
> > + for_each_online_pgdat(pgdat) {
> > + nid = pgdat->node_id;
> > + __mod_node_page_state(NODE_DATA(nid), NR_PAGE_METADATA,
> > + early_perpage_metadata[nid]);
> > + }
> > +}
> > #endif
> > --
> > 2.42.0.283.g2d96d420d3-goog
> >
Yep, thank you! Does store_early_perpage_metadata seem better to you?
[-- Attachment #2: Type: text/html, Size: 4149 bytes --]
next prev parent reply other threads:[~2023-09-14 21:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 17:29 [PATCH v1 0/1] Report perpage " Sourav Panda
2023-09-13 17:30 ` [PATCH v1 1/1] mm: report per-page " Sourav Panda
2023-09-13 17:56 ` Matthew Wilcox
2023-09-14 21:04 ` Sourav Panda [this message]
2023-09-13 19:34 ` kernel test robot
2023-09-13 20:51 ` Mike Rapoport
2023-09-14 12:47 ` Matthew Wilcox
2023-09-14 22:45 ` Sourav Panda
2023-09-14 22:41 ` Sourav Panda
2023-09-13 21:53 ` kernel test robot
2023-09-14 13:00 ` David Hildenbrand
2023-09-14 22:47 ` Sourav Panda
2023-09-18 8:14 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANruzcTYgSHmbYD=uMXuDokOFar+dVHkY1Mm-7BKr7xYW654GQ@mail.gmail.com' \
--to=souravpanda@google.com \
--cc=Liam.Howlett@oracle.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=chenlinxuan@uniontech.com \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=ivan@cloudflare.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
--cc=pasha.tatashin@soleen.com \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=shakeelb@google.com \
--cc=surenb@google.com \
--cc=tomas.mudrunka@gmail.com \
--cc=vbabka@suse.cz \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=yang.yang29@zte.com.cn \
--cc=yosryahmed@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox