Re: [PATCH RFC 2/2] xen/mm: Return claim information from avail_node_heap_pages()
Jan Beulich <[email protected]> Mon, 3 Aug 2026 14:40:00 +0200
| Newsgroups | gmane.comp.emulators.xen.devel |
|---|---|
| Message-ID | <[email protected]> |
On 03.08.2026 14:17, Andrew Cooper wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -2852,12 +2852,14 @@ unsigned long avail_domheap_pages_region(
> return avail_heap_pages(zone_lo, zone_hi, node);
> }
>
> -unsigned long avail_node_heap_pages(unsigned int nodeid)
> +claim_info_t avail_node_heap_pages(unsigned int nodeid)
> {
> + claim_info_t info = {};
> +
> if ( nodeid < MAX_NUMNODES && node_online(nodeid) )
> - return node_avail_pages[nodeid];
> + info.avail = node_avail_pages[nodeid];
>
> - return 0;
> + return info;
> }
Why would this be? What use is a compound return value consisting of two
pieces, only one of which is ever going to be non-zero? In the form
shown for per-node claims that effect goes away, yet at that point the
function name doesn't really reflect its purpose anymore.
As to the naming of claim_info_t - that's perhaps good enough if really
we want to go with the return-by-value approach.
Jan