[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87frqgb1wv.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Wed, 04 Sep 2024 10:14:40 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Davidlohr Bueso <dave@...olabs.net>, Jonathan Cameron
<jonathan.cameron@...wei.com>, Dave Jiang <dave.jiang@...el.com>, Alison
Schofield <alison.schofield@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Dan Williams <dan.j.williams@...el.com>,
linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] cxl/region: Remove lock from memory notifier callback
Hi, Ira,
Ira Weiny <ira.weiny@...el.com> writes:
[snip]
> @@ -2391,18 +2389,6 @@ static bool cxl_region_update_coordinates(struct cxl_region *cxlr, int nid)
> return true;
> }
>
> -static int cxl_region_nid(struct cxl_region *cxlr)
> -{
> - struct cxl_region_params *p = &cxlr->params;
> - struct resource *res;
> -
> - guard(rwsem_read)(&cxl_region_rwsem);
> - res = p->res;
> - if (!res)
> - return NUMA_NO_NODE;
> - return phys_to_target_node(res->start);
> -}
> -
> static int cxl_region_perf_attrs_callback(struct notifier_block *nb,
> unsigned long action, void *arg)
> {
> @@ -2415,7 +2401,7 @@ static int cxl_region_perf_attrs_callback(struct notifier_block *nb,
> if (nid == NUMA_NO_NODE || action != MEM_ONLINE)
> return NOTIFY_DONE;
>
> - region_nid = cxl_region_nid(cxlr);
> + region_nid = phys_to_target_node(cxlr->params.res->start);
Better to add some comments about why we don't need to hold
cxl_region_rwsem to access cxlr->params.res here?
Otherwise, LGTM, Thanks! Feel free to add
Reviewed-by: "Huang, Ying" <ying.huang@...el.com>
in the future versions.
> if (nid != region_nid)
> return NOTIFY_DONE;
>
> @@ -2434,7 +2420,7 @@ static int cxl_region_calculate_adistance(struct notifier_block *nb,
> int *adist = data;
> int region_nid;
>
> - region_nid = cxl_region_nid(cxlr);
> + region_nid = phys_to_target_node(cxlr->params.res->start);
> if (nid != region_nid)
> return NOTIFY_OK;
>
[snip]
--
Best Regards,
Huang, Ying
Powered by blists - more mailing lists