public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Tejun Heo" <tj@kernel.org>,
	phasta@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: Thu, 17 Apr 2025 22:36:11 +0200	[thread overview]
Message-ID: <aAFmO0FhHrzG_F8H@cassiopeiae> (raw)
In-Reply-To: <CAH5fLgg3RrsWy-ArWb9502st3O=DsmPsBsXoZ5M_nS7oWggJuA@mail.gmail.com>

On Thu, Apr 17, 2025 at 10:26:04PM +0200, Alice Ryhl wrote:
> On Thu, Apr 17, 2025 at 9:28 AM Tejun Heo <tj@kernel.org> wrote:
> >
> > On Thu, Apr 17, 2025 at 09:22:40AM +0200, Philipp Stanner wrote:
> > > I assume you, ultimately, mean that the list of delayed_work's would be
> > > accessible through workqueue_struct, correct?
> > >
> > > And then destroy_workqueue() could loop over all of them with
> > > cancel_delayed_work_sync()?
> >
> > Yeap, I was thinking flush_delayed_work() but maybe
> > cancel_delayed_work_sync() is better.
> 
> But doesn't that have a cleanup problem? If the work item owns an
> allocation or a refcount that's cleared by the work item's run
> function, then using cancel_delayed_work_sync() will fail to clean
> that up. Whereas flush_delayed_work() avoids this problem.

I also think it may be a bit unexpected to users if pending "normal" work "will
be done first", but delayed work is canceled instead.

That sounds like a good source for wrong use. :(

  reply	other threads:[~2025-04-17 20:36 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 [this message]
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
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=aAFmO0FhHrzG_F8H@cassiopeiae \
    --to=dakr@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=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=phasta@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tj@kernel.org \
    --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