Linux CXL
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: dan.j.williams@intel.com
Cc: Alison Schofield <alison.schofield@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/2] cxl/region: Timeout auto region assembly waiting for endpoints
Date: Fri, 30 Jan 2026 12:42:49 -0500	[thread overview]
Message-ID: <aXztmSYih24WZgsr@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <697c3a6155b46_1d6f100e1@dwillia2-mobl4.notmuch>

On Thu, Jan 29, 2026 at 08:58:09PM -0800, dan.j.williams@intel.com wrote:
> 
> > Cancel the timeout when all expected endpoints attach or the region is
> > unregistered for any reason.
> 
> Setting aside the above, this looks like policy, and every time I see
> policy the first question is "can userspace do it?". It would be
> straightforward for userspace to kick a 30 second watchdog upon each
> region KOBJ_ADD event. Each time that fires go cleanup partially
> assembled regions.
> 
> For example there is no automatic cleanup of partially assembled RAID
> arrays. So, precedent leans towards letting userspace decide what
> happens when composite devices fail assembly.

Sounds like there'll be a nasty race implied here.

Lets assume a kmem region that gets auto-onlined

0) Region is waiting for a device
   1) Final device arrives and starts probing, locking the region
   2) Userspace timeout occurs, firing a cleanup request
2) Region finishes probing
   2a) this creates the dax region
   2b) this creates the dax_kmem device
   2c) this may auto-hotplug into ZONE_NORMAL
   2d) kernel page gets allocated on the memory region
3) Userspace cleanup arrives to unbind
   3a) dax_kmem is online and can't hot-unplug
   3b) dax_kmem abandons hope and leaves the memory online
       (see dev_dax_kmem_remove and remove_memory)
   3c) region cleans up

Final state: region can't be rebound because memory is left online
and unassociated with any device

This will be hard to get right

~Gregory

  reply	other threads:[~2026-01-30 17:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30  4:23 [PATCH 1/2] cxl/region: Timeout auto region assembly waiting for endpoints Alison Schofield
2026-01-30  4:23 ` [PATCH 2/2] cxl/region: Unregister auto-created region when assembly fails Alison Schofield
2026-01-30 17:45   ` dan.j.williams
2026-01-31  1:04     ` Alison Schofield
2026-01-31 15:49       ` Gregory Price
2026-02-05  0:32         ` Alison Schofield
2026-02-05  4:22           ` Gregory Price
2026-02-03  3:07       ` dan.j.williams
2026-02-05  0:20         ` Alison Schofield
2026-02-05  1:03           ` dan.j.williams
2026-01-30  4:58 ` [PATCH 1/2] cxl/region: Timeout auto region assembly waiting for endpoints dan.j.williams
2026-01-30 17:42   ` Gregory Price [this message]
2026-01-30 18:26     ` dan.j.williams
2026-01-30 19:03       ` Gregory Price
2026-01-30 22:46         ` dan.j.williams

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=aXztmSYih24WZgsr@gourry-fedora-PF4VCD3F \
    --to=gourry@gourry.net \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@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