Re: [RFC PATCH] resource: Fix CXL node not populated issue

Andy Shevchenko
2024-12-02T15:34:27Z

On Mon, Dec 02, 2024 at 11:19:41AM +0000, Raghavendra K T wrote:
> Before:
> ~]$ numastat -m
> ...
> Node 0 Node 1 Total
> --------------- --------------- ---------------
> MemTotal 128096.18 128838.48 256934.65
>
> After:
> $ numastat -m
> .....
> Node 0 Node 1 Node 2 Total
> --------------- --------------- --------------- ---------------
> MemTotal 128054.16 128880.51 129024.00 385958.67
>
> Current patch reverts the effect of first commit where the issue is seen.
>
> git bisect had led to below commit

Missed blank line here.

> Fixes: b4afe4183ec7 ("resource: fix region_intersects() vs add_memory_driver_managed()")

> Cc: Huang Ying <ying.huang@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Davidlohr Bueso <dave@stgolabs.net>
> Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Alison Schofield <alison.schofield@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Alistair Popple <apopple@nvidia.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Baoquan He <bhe@redhat.com>
> Cc: <ilpo.jarvinen@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Fontenot Nathan <Nathan.Fontenot@amd.com>
> Cc: Wei Huang <wei.huang2@amd.com>

Isn't it too many to be included in the commit message? Note you may use the
same list with --cc in the command line with almost the same effect (almost --
no noise in the commit message).

> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
> ---

...

> + bool is_type = (((p->flags & flags) == flags) &&
> + ((desc == IORES_DESC_NONE) ||
> + (desc == p->desc)));
> +
> + if (resource_overlaps(p, &res))
> + is_type ? type++ : other++;

Instead (if you will end up with this approach) please still use is_type_match().

--
With Best Regards,
Andy Shevchenko