Linux CXL
 help / color / mirror / Atom feed
From: Marc Herbert <Marc.Herbert@linux.intel.com>
To: dan.j.williams@intel.com, "ruansy.fnst" <ruansy.fnst@fujitsu.com>,
	linux-cxl@vger.kernel.org
Cc: vishal.l.verma@intel.com, sunfishho12@gmail.com
Subject: Re: [PATCH] test/cxl-xor-region.sh: remove redundant waitting
Date: Mon, 19 May 2025 14:47:36 -0700	[thread overview]
Message-ID: <3f7bd5b0-4c1b-4a55-bc9b-2b6e75ab9a39@linux.intel.com> (raw)
In-Reply-To: <6827d6e591443_4ba8f100f1@dwillia2-mobl4.notmuch>

On 2025-05-16 17:23, dan.j.williams@intel.com wrote:

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

If the distinction between two such "modes" is indeed desired, I don't
think the name should point at the first known use case (UDEV) for
it. For instance, you could also imagine that while some parts of test
code want the current, blocking and "stabilized" behavior, other parts
of some (other) test code want the currently missing), "fast" and
unstable information without waiting. There could be other use cases, so
in general the user interface (if any) should describe what it does, not
who it is for.

Also, why not just a new command line option like cxl --no-wait?
Environment variables are convenient to cut through layers but they are
also invisible which tends to cause debugging nightmares.  Bonus point
when racing against something like else - which is exactly the case
here! I can already feel for the poor soul copying commands from the
logs of some test failure and missing the magic environment
variable(s)... been there, done that.

PS: while... waiting for such a fast/no-wait/unstable option, I see no
reason why systemd would not work.

  reply	other threads:[~2025-05-19 21:47 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 ` [PATCH] test/cxl-xor-region.sh: remove redundant waitting dan.j.williams
2025-05-19 21:47   ` Marc Herbert [this message]
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=3f7bd5b0-4c1b-4a55-bc9b-2b6e75ab9a39@linux.intel.com \
    --to=marc.herbert@linux.intel.com \
    --cc=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