rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Lai Jiangshan" <jiangshanlai@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@gmail.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: rust: add creation of workqueues
Date: Wed, 16 Apr 2025 10:14:34 -1000	[thread overview]
Message-ID: <aAAPqtC_8k0lER62@slm.duckdns.org> (raw)
In-Reply-To: <aAAOwfmi-RcCtA6W@slm.duckdns.org>

On Wed, Apr 16, 2025 at 10:10:41AM -1000, Tejun Heo wrote:
> On Wed, Apr 16, 2025 at 10:08:35PM +0200, Alice Ryhl wrote:
> ...
> > > This should be pretty cheap and we can probably enable this for everyone,
> > > but if the overhead is noticeable, this can be an optional behavior
> > > depending on a workqueue flag.
> > 
> > My only concern is that we're executing work items *before* the
> > deadline they specified. There could be work items that assume this
> > doesn't happen? But maybe it's okay. Otherwise, what you suggest seems
> > reasonable enough to me.
> 
> That's already what flush_delayed_work() does, so I don't think it'd be too
> surprising. Alternatively, we can go for canceling on draining/destruction
> but that'd be more surprising I think. As long as the behavior is documented
> clearly, I don't see problems with running and flushing them.

Also, note that self-requeueing work items may still be pending after
draining a workqueue as the draining is best effort. This is considered a
bug in the caller and, we trigger a warn and just skip freeing the
workqueue. This is again not great but may be acceptable for rust too. If
one wants to improve this, now that we have disable_work(), we can probably
trigger warn after X retries and then switch to disabling & flushing
afterwards.

Thanks.

-- 
tejun

  parent reply	other threads:[~2025-04-16 20:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 15:34 [PATCH] workqueue: rust: add creation of workqueues Alice Ryhl
2025-04-14 17:23 ` Tejun Heo
2025-04-15  9:05   ` Alice Ryhl
2025-04-15 17:03     ` Tejun Heo
2025-04-14 18:15 ` Danilo Krummrich
2025-04-15  9:01   ` Alice Ryhl
2025-04-15 10:48     ` Danilo Krummrich
2025-04-16 12:17       ` Alice Ryhl
2025-04-16 19:41         ` Alice Ryhl
2025-04-16 19:57           ` Tejun Heo
2025-04-17  7:22             ` Philipp Stanner
2025-04-17  7:28               ` Tejun Heo
2025-04-17 20:26                 ` Alice Ryhl
2025-04-17 20:36                   ` Danilo Krummrich
2025-04-17 20:39                   ` Tejun Heo
2025-04-16 19:53         ` Tejun Heo
2025-04-16 20:08           ` Alice Ryhl
2025-04-16 20:10             ` Tejun Heo
2025-04-16 20:12               ` Alice Ryhl
2025-04-16 20:14               ` Tejun Heo [this message]
2025-04-16 20:18                 ` Alice Ryhl

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=aAAPqtC_8k0lER62@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tmgross@umich.edu \
    /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;
as well as URLs for NNTP newsgroup(s).