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

From: Brendan Jackman

Date: Mon Jun 22 2026 - 06:27:13 EST


On Mon Jun 22, 2026 at 10:10 AM UTC, sashiko-bot wrote:
> 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?

Repeating myself[0] as this patch has a different CC list from the others:

Sashiko is correct, the commit message says "former" but it should say
"latter".

[0] https://lore.kernel.org/all/DJFI39RWHV1O.MMMMMZSK8E8C@xxxxxxxxx/