[LTP] [PATCH] sys_cpu_topology02: Drop upper bound on core_id

Hubert Mazur hmazur@google.com
Wed Dec 2 09:21:34 CET 2026


Hi Petr,

Thanks for the review and for confirming on your laptop!

On Tue, 1 Dec 2026 17:24:41 +0100, Petr Vorel wrote:
> The main concern I have is that you left poss_max_id variable which is now
> useless. This part is not needed any more:
>
> 	if (tst_is_virt(VIRT_ANY))
> 		pkg_max_id = LONG_MAX;
> 	else
> 		pkg_max_id = poss_max_id;
>
> (and the variable declaration itself, of course).

poss_max_id and that if/else block are still used to set pkg_max_id on
bare metal for the physical_package_id check:

	TST_SYSFS_ASSERT_RANGELL(-1, pkg_max_id,
			       PATH_SYS_CPU "/cpu%d/topology/physical_package_id",
			       cpu);

which v1 intentionally left untouched.

If we also want to remove poss_max_id and that block, we would need to
drop the bare-metal upper bound on physical_package_id as well (using
LONG_MAX unconditionally, removing the pkg_max_id parameter from
check_cpu_topology(), updating the physical_package_id doc comment, and
either passing NULL for max_id in the TST_SYSFS_ASSERT_PARSE_LIST() call
on possible or dropping that assert too).

> Please instead of plain Documentation/ABI/stable/sysfs-devices-system-cpu use
> :kernel_tree:`Documentation/ABI/stable/sysfs-devices-system-cpu`
>
> Also, I updated formatting of the docs, please rebase for v2.

Done! I am sending v2 rebased onto commit b603b3a875a9 with the
:kernel_tree: role, while keeping poss_max_id / pkg_max_id for
physical_package_id. Since your Reviewed-by tag was conditional on
removing poss_max_id, I omitted it from v2 -- please let me know if
keeping the physical_package_id bound looks good or if you and Cyril
prefer dropping it too.

Thanks,
Hubert


More information about the ltp mailing list