From: <dan.j.williams@intel.com>
To: ruansy.fnst <ruansy.fnst@fujitsu.com>, <linux-cxl@vger.kernel.org>
Cc: <dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
<sunfishho12@gmail.com>, Ruan Shiyang <ruansy.fnst@fujitsu.com>
Subject: Re: [PATCH] test/cxl-xor-region.sh: remove redundant waitting
Date: Fri, 16 May 2025 17:23:01 -0700 [thread overview]
Message-ID: <6827d6e591443_4ba8f100f1@dwillia2-mobl4.notmuch> (raw)
In-Reply-To: <20250514112003.2150272-1-ruansy.fnst@fujitsu.com>
ruansy.fnst wrote:
> From: Ruan Shiyang <ruansy.fnst@fujitsu.com>
>
> Now that cxl_wait_probe() has been added[1] to wait for udev queue
> empty, the `udevadm settle` here is no longer necessary.
>
> [1] b231603 cxl/lib: Add cxl_wait_probe()
>
> Signed-off-by: Ruan Shiyang <ruansy.fnst@fujitsu.com>
>
> ===
> Question to Dan:
>
> I understand how cxl_wait_probe() work, but I have some questions about
> the motivation of adding this function: Firstly, is it function added
> for simply waiting for new added CXL device been ready before cxl
> command does the actual work? Just for replacing `udevadm settle`'s
> work?
No the motivation is that a command like "cxl list" wants to be to
determine that a given object is "enabled", i.e. driver attached. At any
given point of the time the cxl_pci driver could be going through async
attach, and the arrival of the cxl_acpi driver may trigger
cxl_bus_rescan().
So the assumption is that interfactive invocation of cxl commands should
arrange for a stablized snaphshot of the topology state.
> Now I am facing a problem that cxl command takes a long time to complete
> when I run it in a udev rule(do some configuration when CXL memdev is
> added). I found it is caused by this function: waitting for udev
> queue's endding but itself is in the queue. The cxl_wait_probe()
> function does not seem to allow me to do that.
Yes, that is a problem.
> So, the 2nd question is: is it against the spec to run cxl command in
> a udev rule?
No we need to find a way to make that work, so I consider this a bug
report. My initial reaction is that when called from a udev rule cxl-cli
should honor a new environment variable, perhaps "UDEV_CXL", that
disables this waiting that is only meant for human interactive mode.
The udev rule would need to know the potential asynchronous states of
the topology. However, as long as it is performing object local
operations it should be fine. For example "UDEV_CXL=1; cxl list -m
$memdev", where $memdev just experienced the "add" uevent, should just
dump that object's details without waiting for the rest of the topology
to settle.
next prev parent reply other threads:[~2025-05-17 0:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 11:20 [PATCH] test/cxl-xor-region.sh: remove redundant waitting ruansy.fnst
2025-05-16 21:36 ` Alison Schofield
2025-05-20 3:54 ` Shiyang Ruan
2025-05-16 23:50 ` cxl <-> udev deadlock? Marc Herbert
2025-05-17 0:23 ` dan.j.williams [this message]
2025-05-19 21:47 ` [PATCH] test/cxl-xor-region.sh: remove redundant waitting Marc Herbert
2025-05-19 23:09 ` Dan Williams
2025-05-20 1:00 ` Marc Herbert
2025-05-20 3:38 ` Shiyang Ruan
2025-05-20 5:26 ` Marc Herbert
2025-05-28 20:49 ` Alison Schofield
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=6827d6e591443_4ba8f100f1@dwillia2-mobl4.notmuch \
--to=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=ruansy.fnst@fujitsu.com \
--cc=sunfishho12@gmail.com \
--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