[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.22 v2 4/5] tests/numa: add unit tests for NUMA setup logic


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 5 Jun 2026 17:22:44 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=k5933RkXps1DxWL9uFpl/G5QCQvGCrfzQWg1COmW+dc=; b=HQoiKT2ZjI5JKQZPZgxs+N0KkfRWBV2ZbPfB4n7EGaFYrllePDCTs0lTb5Yffi793NT/cQJPjCjNAvbXFFwP1v9f14i9hHcLqQ6BqUJwGP0q9LeQAbacG5lFUGr43hNXSiXz415a8Qz2IzizCR35Aq0IHtqmClyyVLHzgemFhD5CLmTb/lOHfPxq1qL70bHDIEX/2p2mHeNO8EC7ipVLaWfi5P0G8vfDo6FGX7EQ1rerm1tzc8uHxNR4fIXYXz3Y63bikOeqc+rnJgJ8mes81qOx5r+hMXnxadAHLJ3hrrqPt4dNOxVSlq8vYrA3uSjupobBt/NnfaQpm4icCYlzqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H7IhFcF3oj5fbJqxYYR1ojea7nT5ZfdJWqi0MwXDkq4iU4XPxNOC0lAwOiejBnssiHZffDnE1DaInDEKilXm4e22hK0qGyFLCPihvpENNdEuwcLpQ838E8kPihK8FlIT69YReZ1blfkcms8j29OEWXGVu/UlahXyD9uFN8skySIDDXL4YSgnouCfVNQS3jcldsJEAg4x2l1RLfl2rKrybkcVtMFgXOcQcrKdcVTiF4UkHQjdr4+f4tS9yfyIwA6Fy/zEyYBKmS669wv1f4ZRP2O+Hfa9P+pAxIsFWWmEZgNIbsVITLv4lOvVMIkxnilAHsWNUWSbURNW7MDdC+epHg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 05 Jun 2026 15:23:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jun 05, 2026 at 05:10:23PM +0200, Anthony PERARD wrote:
> On Wed, Jun 03, 2026 at 09:18:35PM +0200, Roger Pau Monne wrote:
> > diff --git a/tools/tests/numa/Makefile b/tools/tests/numa/Makefile
> > new file mode 100644
> > index 000000000000..5235f9d6297f
> > --- /dev/null
> > +++ b/tools/tests/numa/Makefile
> > +
> > +.PHONY: uninstall
> > +uninstall:
> > +   $(RM) -- $(patsubst %,$(DESTDIR)$(LIBEXEC)/tests/%,$(TARGETS))
> 
> There's a simpler way to write this, with
>     $(addprefix $(DESTDIR)$(LIBEXEC)/tests/,$(TARGETS))
> But that's ok to.

I've merely c&p what we had in other Makefiles, and didn't think much
about the specific runes.  I will leave that one alone if you don't
mind, we could always do a sweep change of this pattern in
tools/tests.

> > +
> > +numa.h: $(XEN_ROOT)/xen/include/xen/numa.h
> > +   sed -e '/^#[[:space:]]*include/d' <$< >$@
> > +
> > +CFLAGS += -D__XEN_TOOLS__
> > +CFLAGS += $(APPEND_CFLAGS)
> > +CFLAGS += $(CFLAGS_xeninclude)
> > +
> > +test-numa: test-numa.c numa.h
> > +   $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -o $@ $< $(APPEND_CFLAGS)
> 
> $* should be undefined here.
> So we have $(CFLAGS_.o), but that variable doesn't exit either.
> You could remove $(CFLAGS_$*.o), it's not use here.

Ack.

> Also, $(APPEND_CFLAGS) is added twice, once via $(CFLAGS) and a second
> time on the command line. I think the one added to $(CFLAGS) should be
> removed.

Done, will remove that from CLFAGS then.

> > diff --git a/tools/tests/numa/test-numa.c b/tools/tests/numa/test-numa.c
> > new file mode 100644
> > index 000000000000..bced68d4d7f1
> > --- /dev/null
> > +++ b/tools/tests/numa/test-numa.c
> > +
> > +        for ( j = 0;
> > +              j < ARRAY_SIZE(tests[i].affinity) && 
> > tests[i].affinity[j].end;
> 
> Why do you test the value `.end` ? ARRAY_SIZE is likely enough as the
> test array is static. Same thing later, with the `ram` array.

To skip processing empty/uninitialized entries (ie: ones with start
== end == 0).

> 
> 
> Anyway, it's all look good enough to me:
> Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks, will do the above changes and do one last pre-push CI run.

Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.