lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_4hTBFdodhXkArL@google.com>
Date: Tue, 15 Apr 2025 09:05:16 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Tejun Heo <tj@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Lai Jiangshan <jiangshanlai@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, 
	Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, Daniel Almeida <daniel.almeida@...labora.com>, 
	Tamir Duberstein <tamird@...il.com>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] workqueue: rust: add creation of workqueues

On Mon, Apr 14, 2025 at 07:23:42AM -1000, Tejun Heo wrote:
> Hello,
> 
> On Fri, Apr 11, 2025 at 03:34:24PM +0000, Alice Ryhl wrote:
> > Creating workqueues is needed by various GPU drivers. Not only does it
> > give you better control over execution, it also allows devices to ensure
> > that all tasks have exited before the device is unbound (or similar) by
> > running the workqueue destructor.
> > 
> > This patch is being developed in parallel with the new Owned type [1].
> > The OwnedQueue struct becomes redundant once [1] lands; at that point it
> > can be replaced with Owned<Queue>, and constructors can be moved to the
> > Queue type.
> > 
> > A wrapper type WqFlags is provided for workqueue flags. Since we only
> > provide the | operator for this wrapper type, this makes it impossible
> > to pass internal workqueue flags to the workqueue constructor. It has
> > the consequence that we need a separate constant for the no-flags case,
> > as the constructor does not accept a literal 0. I named this constant
> > "BOUND" to signify the opposite of UNBOUND.
> 
> Maybe name it NONE or DUMMY? Doesn't affect this patch but [UN]BOUND are a
> bit confusing and as a part of the effort to reduce unnecessary usage of
> cpu-bound workqueues, there's a plan to flip the default and use PERCPU for
> the cpu-bound workqueues.

Happy with whatever you think is best, but what about naming the
constant PERCPU, then? In fact, by adjusting how I declare the flags in
Rust, it is possible to *force* the user to include exactly one of
PERCPU, UNBOUND, or BH in the flags argument.

Of course, also happy to continue with NONE and adjust it when you flip
the default value.

Alice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ