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:Liam 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:
Andrew Morton <akpm@linux-foundation.org>
Loading
Please register or sign in to comment