Re: [PATCH] cxl/test: Map mock device nodes to an online node
Dave Jiang <[email protected]>
| Newsgroups | org.kernel.vger.linux-cxl |
|---|---|
| Message-ID | <[email protected]> |
On 8/19/26 9:19 AM, Gregory Price wrote:
> On Thu, Jul 23, 2026 at 11:06:30AM -0700, Davidlohr Bueso wrote:
>> cxl_mem_init() assigns alternating NUMA nodes to the mock memdevs
>> to model multi-node topologies. On a single-node host node 1 has
>> no pgdat, and the first node-aware allocation in an odd device's
>> probe faults on a NULL zonelist:
>>
>> Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3
>> KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f]
>> Workqueue: async async_run_entry_fn
>> RIP: __alloc_frozen_pages_noprof+0x288
>> new_slab
>> ___slab_alloc
>> __kmalloc_node_track_caller_noprof
>> devm_kmalloc
>> cxl_mock_mem_probe
>>
>> Map the requested node to an online one, as dax_hmem already does
>> for its target node.
>>
>> Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute")
>> Fixes: e41c8452b9b2 ("tools/testing/cxl: Add a single-port host-bridge regression config")
>> Fixes: c9435dbee119 ("tools/testing/cxl: Add an RCH topology")
>
> I think should only have a single fixes tag? Otherwise seems it seems
> unclear where/how to backport?
Issues started with this commit:
Fixes: 17c38c88294d ("slab: remove cpu (partial) slabs usage from allocation paths")
But we probably should just use this:
Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute")
Also, this patch needs to be rebased for v7.3-rc1 due type2 changes for 7.3.
DJ
>
>> Signed-off-by: Davidlohr Bueso <[email protected]>
>
> Reviewed-by: Gregory Price (Meta) <[email protected]>
>
>> ---
>> Found while regression testing unrelated work.
>>
>> tools/testing/cxl/test/cxl.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
>> index ef92dd35e030..5156516a82d2 100644
>> --- a/tools/testing/cxl/test/cxl.c
>> +++ b/tools/testing/cxl/test/cxl.c
>> @@ -1748,7 +1748,7 @@ static int cxl_mem_init(void)
>> if (!pdev)
>> goto err_mem;
>> pdev->dev.parent = &dport->dev;
>> - set_dev_node(&pdev->dev, i % 2);
>> + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
>>
>> rc = cxl_mock_platform_device_add(pdev, &cxl_mem[i]);
>> if (rc)
>> @@ -1763,7 +1763,7 @@ static int cxl_mem_init(void)
>> if (!pdev)
>> goto err_single;
>> pdev->dev.parent = &dport->dev;
>> - set_dev_node(&pdev->dev, i % 2);
>> + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
>>
>> rc = cxl_mock_platform_device_add(pdev, &cxl_mem_single[i]);
>> if (rc)
>> @@ -1779,7 +1779,7 @@ static int cxl_mem_init(void)
>> if (!pdev)
>> goto err_rcd;
>> pdev->dev.parent = &rch->dev;
>> - set_dev_node(&pdev->dev, i % 2);
>> + set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
>>
>> rc = cxl_mock_platform_device_add(pdev, &cxl_rcd[i]);
>> if (rc)
>> --
>> 2.39.5
>>
>>