Re: [PATCH v3 2/2] rust: workqueue: add creation of workqueues
From: Danilo Krummrich
Date: Fri Feb 27 2026 - 10:38:33 EST
On Fri Feb 27, 2026 at 3:53 PM CET, Alice Ryhl wrote:
> + /// Set the maximum number of active cpus.
> + ///
> + /// If not set, a reasonable default value is used. The maximum value is `WQ_MAX_ACTIVE`.
Should we just mention the default value?
> + #[inline]
> + pub fn max_active(mut self, max_active: u32) -> Builder {
> + self.max_active = i32::try_from(max_active).unwrap_or(i32::MAX);
The workqueue code prints a warning for max_active > WQ_MAX_ACTIVE. Maybe use
debug_assert()?
It's also a bit unfortunate that alloc_ordered_workqueue() becomes
.max_active(1).
At the same time having a separate ordered() method competes with max_active().
Mybe a type state, i.e. Builder<Ordered> that doesn't have max_active()?
> + self
> + }