linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liam Ni <zhiguangni01@gmail.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org,  tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, hpa@zytor.com,  akpm@linux-foundation.org,
	rppt@kernel.org, x86@kernel.org,  linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] x86,NUMA:Get the number of ram pages directly in numa_meminfo_cover_memory()
Date: Thu, 22 Jun 2023 13:06:10 +0800	[thread overview]
Message-ID: <CACZJ9cU81BObhY3RGb9mdhfWxqhNW=JhjSOyUXpizZ-S8hjdEQ@mail.gmail.com> (raw)
In-Reply-To: <22bba771-f10b-8624-1874-5eb747e798dd@intel.com>

On Thu, 22 Jun 2023 at 01:49, Dave Hansen <dave.hansen@intel.com> wrote:
>
> On 6/15/23 07:20, Liam Ni wrote:
> > In a previous implementation,The ram page is calculated
> > by counting the number of holes,
> > however,the number of ram pages is calculated during hole calculation.
> > Therefore,we can directly calculate the amount of ram pages.
>
> What problem does this patch solve?

I has send patch V2 to improve the execution efficiency of
numa_meminfo_cover_memory()
by optimize the way of calculating missing pages.

patch V2:
https://lore.kernel.org/all/20230619075315.49114-1-zhiguangni01@gmail.com/

In the previous implementation, We calculate missing pages as follows:
1. calculate numaram by traverse all the numa_meminfo's and for each of
them traverse all the regions in memblock.memory to prepare for
counting missing pages.

2. Traverse all the regions in memblock.memory again to get e820ram.

3. the missing page is (e820ram - numaram )

But,it's enough to count memory in memblock.memory that doesn't have
the node assigned.
we only need to traverse memblock.memory **once**.


      reply	other threads:[~2023-06-22  5:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 14:20 Liam Ni
2023-06-15 17:00 ` Mike Rapoport
2023-06-17 10:47   ` Liam Ni
2023-06-18  7:08     ` Mike Rapoport
2023-06-18  7:30       ` Liam Ni
2023-06-21 17:49 ` Dave Hansen
2023-06-22  5:06   ` Liam Ni [this message]

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='CACZJ9cU81BObhY3RGb9mdhfWxqhNW=JhjSOyUXpizZ-S8hjdEQ@mail.gmail.com' \
    --to=zhiguangni01@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rppt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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