Re: [PATCH v3] mm: fix panic in __alloc_pages

From: Michal Hocko
Date: Tue Nov 16 2021 - 04:17:16 EST


On Tue 16-11-21 01:31:44, Alexey Makhalov wrote:
[...]
> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
> index 6737b1cbf..bbc1a70d5 100644
> --- a/drivers/acpi/acpi_processor.c
> +++ b/drivers/acpi/acpi_processor.c
> @@ -200,6 +200,10 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
> * gets online for the first time.
> */
> pr_info("CPU%d has been hot-added\n", pr->id);
> + {
> + int nid = cpu_to_node(pr->id);
> + printk("%s:%d cpu %d, node %d, online %d, ndata %p\n", __FUNCTION__, __LINE__, pr->id, nid, node_online(nid), NODE_DATA(nid));
> + }
> pr->flags.need_hotplug_init = 1;

OK, IIUC you are adding a processor which is outside of
possible_cpu_mask and that means that the node is not allocated for such
a future to be hotplugged cpu and its memory node. init_cpu_to_node
would have done that initialization otherwise. I think you want to talk
to x86 maintainers and people who have introduced a support for
memoryless nodes for x86.

To me it seems like you are trying to use a functionality that has
never been properly implemented. I do not remember how other acpi based
architectures handle this and maybe we need a generic solution and that
would bring up the node as soon as a new cpu is hot added.
--
Michal Hocko
SUSE Labs