x86/mm/numa: Remove numa_nodemask_from_meminfo()
authorWei Yang <richard.weiyang@gmail.com>
Tue, 14 Mar 2017 03:08:01 +0000 (11:08 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 3 Apr 2017 09:54:37 +0000 (11:54 +0200)
commit474aeffd88b87746a75583f356183d5c6caa4213
tree9b1b66516861433610d8da6f17060e254d12bd69
parent43dac8f6a74c9811454f4efbe52b48f7a802c277
x86/mm/numa: Remove numa_nodemask_from_meminfo()

numa_nodemask_from_meminfo() generates a nodemask of nodes which have
memory according to a meminfo descriptor.

The two callsites of that function both set bits in copies of the
numa_nodes_parsed nodemask. In both cases, the information in supplied
numa_meminfo is a subset of numa_nodes_parsed. So setting those bits
again is not really necessary.

Here are the three call paths which show that the supplied numa_meminfo
argument describes memory regions in nodes which are already in
numa_nodes_parsed:

    x86_numa_init()
        numa_init()
            Case 1:
            acpi_numa_init()
    acpi_parse_memory_affinity()
                    numa_add_memblk()
                    node_set(numa_nodes_parsed)
                acpi_parse_slit()
 acpi_numa_slit_init()
  numa_set_distance()
   numa_alloc_distance()
                    numa_nodemask_from_meminfo()

            Case 2:
            amd_numa_init()
                numa_add_memblk()
                node_set(numa_nodes_parsed)

            Case 3
            dummy_numa_init()
                node_set(numa_nodes_parsed)
                numa_add_memblk()

            numa_register_memblks()
                numa_nodemask_from_meminfo()

Thus, in all three cases, the respective bit in numa_nodes_parsed is
set, which means it is not necessary to set it again in a copy of
numa_nodes_parsed.

So remove that function.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/20170314030801.13656-2-richard.weiyang@gmail.com
[ Heavily massage commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/mm/numa.c