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

From: Raghavendra K T
Date: Tue Dec 03 2024 - 01:02:01 EST


++ Huang new address
Thank you for looking into patch Andy.
On 12/2/2024 9:04 PM, Andy Shevchenko wrote:
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.


Will add.

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

Cc: Huang Ying <ying.huang@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx>
Cc: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
Cc: Dave Jiang <dave.jiang@xxxxxxxxx>
Cc: Alison Schofield <alison.schofield@xxxxxxxxx>
Cc: Vishal Verma <vishal.l.verma@xxxxxxxxx>
Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
Cc: Alistair Popple <apopple@xxxxxxxxxx>
Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Baoquan He <bhe@xxxxxxxxxx>
Cc: <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Cc: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
Cc: Fontenot Nathan <Nathan.Fontenot@xxxxxxx>
Cc: Wei Huang <wei.huang2@xxxxxxx>

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).

Agree. Do not want to add in the final commit message. I took
the names from the bisected message. will Cc directly next time.


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

...

+ 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().


Sure will do in next iteration unless someone comes with expected fix.

I bumped into this because I was not able to evaluate my patches
on 6.13 with CXL card. Thought of reporting what worked for me...

Link: : https://lore.kernel.org/all/20241201153818.2633616-1-raghavendra.kt@xxxxxxx/

I may need some time to go back and understand some history and code.

Thanks and Regards
- Raghu