From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: <sthanneeru.opensrc@micron.com>, <linux-cxl@vger.kernel.org>,
<linux-mm@kvack.org>, <john@jagalactic.com>,
<emirakhur@micron.com>, <ajayjoshi@micron.com>,
<Ravis.OpenSrc@micron.com>, <sthanneeru@micron.com>
Subject: Re: [RFC PATCH] cxl/pci: Set default timeout for background operations
Date: Thu, 15 Feb 2024 12:34:10 +0000 [thread overview]
Message-ID: <20240215123410.00003b8c@Huawei.com> (raw)
In-Reply-To: <65cd858b3e5bc_5c76294dc@dwillia2-mobl3.amr.corp.intel.com.notmuch>
On Wed, 14 Feb 2024 19:31:23 -0800
Dan Williams <dan.j.williams@intel.com> wrote:
> sthanneeru.opensrc@ wrote:
> > From: Srinivasulu Thanneeru <sthanneeru.opensrc@micron.com>
> >
> > The CXL 3.0 specification outlines background operations,
> > and support for handling these operations was added in following patch.
> >
> > Link: https://lore.kernel.org/all/20230523170927.20685-5-dave@stgolabs.net/
> >
> > Mailbox commands like ‘Log Populate’ use background operations
> > to complete the execution of the command.
> > This can lead to a timeout, since there is currently no option
> > in the ioctl cxl_send_command structure to specify
> > a timeout value. The default values being zero can lead
> > to the driver reporting false negatives to the application.
> >
> > This patch aims to establish default values, enabling mailbox commands
> > that operate in the background to continue functioning even
> > if a timeout is not set in the userspace application.
>
> The reason there are no defaults is because userspace is not allowed to
> issue background commands. The CXL background command definition is
> awkward in that it allows a single command to monopolize the mailbox for
> an indefinite amount of time.
>
> Instead, the approach taken with Firmware Update and Sanitize is that a
> kernel sysfs ABI mediates access to the mailbox and facilitates bounded
> timeslices between command submissions. It effectively allows the kernel
> to manage fairness and more importantly preempt userspace if it needs to
> issue its own commands.
>
> I assume you are only seeing this lack of a default due to building with
> CONFIG_CXL_MEM_RAW_COMMANDS=y? If yes, "raw" means "raw" and the kernel
> is mostly taken out of the loop of saving userspace from itself.
>
> All that said, ugh, "Log Populate" has no facility to time bound the
> population of the log. I do not think it is tenable for Linux to
> surrender mailbox access for an indefinite uninterruptible amount of
> time... unless you want to handle "Log Populate" like Sanitize where the
> unbounded background operation is tolerated because the device is taken
> offline?
It may be pointless to do a component state dump only on an offline device.
My assumption is this one is hardware debug only. Patches out of
tree or behind a really scary sounding config variable perhaps?
Other than vendor log I don't think populate log applies to the other
log types yet (they don't mention it anyway!)
Jonathan
next prev parent reply other threads:[~2024-02-15 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 10:53 [RFC PATCH] cxl/pci: Set default timeout for background operations sthanneeru.opensrc
2024-02-15 3:31 ` Dan Williams
2024-02-15 12:34 ` Jonathan Cameron [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-09-02 6:42 Shinas Rasheed
2024-09-13 11:52 ` 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=20240215123410.00003b8c@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=Ravis.OpenSrc@micron.com \
--cc=ajayjoshi@micron.com \
--cc=dan.j.williams@intel.com \
--cc=emirakhur@micron.com \
--cc=john@jagalactic.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sthanneeru.opensrc@micron.com \
--cc=sthanneeru@micron.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.