Skip to content
Commit 47a021e3 authored by Liam Ni's avatar Liam Ni Committed by Andrew Morton
Browse files

NUMA: improve the efficiency of calculating pages loss

Optimize the way of calculating missing pages.

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.

Link: https://lkml.kernel.org/r/20230911133852.2545-1-zhiguangni01@gmail.com


Signed-off-by: default avatarLiam Ni <zhiguangni01@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 01df2305
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment