Re: [PATCH v2 06/13] KVM: VMX: Use higher-level allocator

From: sashiko-bot

Date: Mon Jun 22 2026 - 06:11:05 EST


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message incorrectly states that `__alloc_pages_node()` allows passing `NUMA_NO_NODE`, while the opposite is true.
--

commit 7bd439c242125db27305b61b14c9972fb028282a
Author: Brendan Jackman <jackmanb@xxxxxxxxxx>

KVM: VMX: Use higher-level allocator

This commit switches the allocation function used in alloc_vmcs_cpu()
from __alloc_pages_node() to alloc_pages_node().

> KVM: VMX: Use higher-level allocator
>
> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.

[Severity: Medium]
Is this description inverted?

Looking at include/linux/gfp.h, it appears __alloc_pages_node() explicitly
forbids NUMA_NO_NODE (-1) via VM_BUG_ON(nid < 0).

Instead, it is alloc_pages_node() that handles NUMA_NO_NODE by explicitly
checking for it and falling back to numa_mem_id().

While the code change itself is safe, the justification reverses the
behavior of the two APIs. Could the commit message be updated to
accurately reflect the API semantics?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@xxxxxxxxxx?part=6