From: Dan Williams <dan.j.williams@intel.com>
To: <sthanneeru.opensrc@micron.com>, <linux-cxl@vger.kernel.org>,
<linux-mm@kvack.org>
Cc: <Jonathan.Cameron@huawei.com>, <dan.j.williams@intel.com>,
<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: Wed, 14 Feb 2024 19:31:23 -0800 [thread overview]
Message-ID: <65cd858b3e5bc_5c76294dc@dwillia2-mobl3.amr.corp.intel.com.notmuch> (raw)
In-Reply-To: <20240207105349.301-1-sthanneeru.opensrc@micron.com>
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?
next prev parent reply other threads:[~2024-02-15 3:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 10:53 sthanneeru.opensrc
2024-02-15 3:31 ` Dan Williams [this message]
2024-02-15 12:34 ` Jonathan Cameron
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=65cd858b3e5bc_5c76294dc@dwillia2-mobl3.amr.corp.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Ravis.OpenSrc@micron.com \
--cc=ajayjoshi@micron.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox