From: Dan Williams <dan.j.williams@intel.com>
To: Dave Jiang <dave.jiang@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: <linux-cxl@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
<dan.j.williams@intel.com>, <ira.weiny@intel.com>,
<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
<dave@stgolabs.net>, <rafael@kernel.org>,
<gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Huang, Ying" <ying.huang@intel.com>
Subject: Re: [PATCH v6 11/12] cxl/region: Add memory hotplug notifier for cxl region
Date: Thu, 7 Mar 2024 16:01:43 -0800 [thread overview]
Message-ID: <65ea5567a5c59_1ecd2947d@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <1dfdec49-5d37-4117-96d6-3191cb12ee2d@intel.com>
Dave Jiang wrote:
>
>
> On 3/6/24 7:53 AM, Jonathan Cameron wrote:
> > On Tue, 20 Feb 2024 16:12:40 -0700
> > Dave Jiang <dave.jiang@intel.com> wrote:
> >
> >> When the CXL region is formed, the driver would computed the performance
> >> data for the region. However this data is not available at the node data
> >> collection that has been populated by the HMAT during kernel
> >> initialization. Add a memory hotplug notifier to update the access
> >> coordinates to the 'struct memory_target' context kept by the
> >> HMAT_REPORTING code.
> >>
> >> Add CXL_CALLBACK_PRI for a memory hotplug callback priority. Set the
> >> priority number to be called before HMAT_CALLBACK_PRI. The CXL update must
> >> happen before hmat_callback().
> >>
> >> A new HMAT_REPORING helper hmat_update_target_coordinates() is added in
> >
> > REPORTING
> >
> >> order to allow CXL to update the memory_target access coordinates.
> >>
> >> A new ext_updated member is added to the memory_target to indicate that
> >> the access coordinates within the memory_target has been updated by an
> >> external agent such as CXL. This prevents data being overwritten by the
> >> hmat_update_target_attrs() triggered by hmat_callback().
> >>
> >> Cc: Andrew Morton <akpm@linux-foundation.org>
> >> Cc: Rafael J. Wysocki <rafael@kernel.org>
> >> Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
> >> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[..]
> >> +
> >> static int cxl_region_probe(struct device *dev)
> >> {
> >> struct cxl_region *cxlr = to_cxl_region(dev);
> >> @@ -3081,6 +3151,12 @@ static int cxl_region_probe(struct device *dev)
> >> goto out;
> >> }
> >>
> >> + cxlr->memory_notifier.notifier_call = cxl_region_perf_attrs_callback;
> >> + cxlr->memory_notifier.priority = CXL_CALLBACK_PRI;
> >> + register_memory_notifier(&cxlr->memory_notifier);
> >> + rc = devm_add_action_or_reset(&cxlr->dev, remove_coord_notifier,
> >> + &cxlr->memory_notifier);
> >> +
> >
> > Check rc? Very unlikely to fail, but you never know..
>
> It's actually checked a few lines down after cxl_region_sem gets released. Probably too far away for diff to include it.
Why does this need to be done late in cxl_region_probe() and not
something like devm_cxl_add_region() and unregistered in
unregister_region()?
next prev parent reply other threads:[~2024-03-08 0:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 23:12 [PATCH v6 0/12] cxl: Add support to report region access coordinates to numa nodes Dave Jiang
2024-02-20 23:12 ` [PATCH v6 01/12] ACPI: HMAT: Remove register of memory node for generic target Dave Jiang
2024-02-20 23:12 ` [PATCH v6 02/12] base/node / ACPI: Enumerate node access class for 'struct access_coordinate' Dave Jiang
2024-03-07 21:02 ` Greg KH
2024-02-20 23:12 ` [PATCH v6 03/12] ACPI: HMAT: Introduce 2 levels of generic port access class Dave Jiang
2024-02-27 17:23 ` Jonathan Cameron
2024-02-20 23:12 ` [PATCH v6 04/12] ACPI: HMAT / cxl: Add retrieval of generic port coordinates for both access classes Dave Jiang
2024-02-20 23:12 ` [PATCH v6 05/12] cxl: Split out combine_coordinates() for common shared usage Dave Jiang
2024-02-27 17:25 ` Jonathan Cameron
2024-02-20 23:12 ` [PATCH v6 06/12] cxl: Split out host bridge access coordinates Dave Jiang
2024-02-20 23:12 ` [PATCH v6 07/12] cxl: Move QoS class to be calculated from the nearest CPU Dave Jiang
2024-02-20 23:12 ` [PATCH v6 08/12] cxl: Set cxlmd->endpoint before adding port device Dave Jiang
2024-02-20 23:12 ` [PATCH v6 09/12] cxl/region: Calculate performance data for a region Dave Jiang
2024-02-20 23:12 ` [PATCH v6 10/12] cxl/region: Add sysfs attribute for locality attributes of CXL regions Dave Jiang
2024-03-06 14:48 ` Jonathan Cameron
2024-02-20 23:12 ` [PATCH v6 11/12] cxl/region: Add memory hotplug notifier for cxl region Dave Jiang
2024-03-06 14:53 ` Jonathan Cameron
2024-03-07 23:51 ` Dave Jiang
2024-03-08 0:01 ` Dan Williams [this message]
2024-02-20 23:12 ` [PATCH v6 12/12] cxl/region: Deal with numa nodes not enumarated by SRAT Dave Jiang
2024-03-06 14:55 ` [PATCH v6 0/12] cxl: Add support to report region access coordinates to numa nodes Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65ea5567a5c59_1ecd2947d@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).