From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D4FB3644D5 for ; Fri, 27 Feb 2026 19:05:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772219129; cv=none; b=ltziedFqW37Ps8nuhRH2WFqyk6ZEO6DjfClLiYCH1AmiMrqngC0zD2kfOuONr/oIwQX1lodaK/TB8pzosy+WWaY+uUd+WzE6lAGAl9Cu2KZbtuk5oYI6QWJH3VbPXYgo3fcStSlrz3YOfMIYwVKUWj6YW++BBXPdYwdz6nHFLjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772219129; c=relaxed/simple; bh=mRI42A/KJodvD+27BzCr9+bgb9ZsIAZvL+st7xYBGOw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mLjjsebdDPpIYrk3E8DdWwvojnngn1ucRDWmpxTc/DEwUNmXmEiAGq0yl6i4GBXpYXxfC5VDBE2lpy3wC8nxjv6py7pYQzqFaYbyTgHekVTZzBNG4QbIj0255pHVa73C6wpM+x4qAv2omlRyYye15bFELicIE3OBYp7WXyf/DAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KU4F48NW; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KU4F48NW" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4837907ec88so26333845e9.0 for ; Fri, 27 Feb 2026 11:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772219127; x=1772823927; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=pikDANfbE4Ok0e2Gfb8emUSEkVp07jBYXIodBMXISOU=; b=KU4F48NWX0z+2I85n8W8o+fl8Fql5qswzTsWHQiSMETPxx/G6ePTPBwFHtg1bfywNl tXi8ZVyRwM40pWWCb4Ex9crYg/M3ouoDZoUVBWhjNgw3XZAhCdByXNMoDQUGtcb4refF qTENpvZCA964Z8Xhxfsrl2O9+LuL3D42iFSk/pMIwm8Lnsgs6JU7+8tCMqw7uMWcBqjX xX0W3VLyynbZ8LyKGxC/dJ8Tx15TNVTtXVW9Up+a75uRA9TQ54/rTlo0XSCLBMecCEoh d69emx2cVJHoT8GqKKmLRsWohogHsi40asJs5g1uLVtASEQ34j5cv3jEQrKW+vM8wfoe LFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772219127; x=1772823927; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pikDANfbE4Ok0e2Gfb8emUSEkVp07jBYXIodBMXISOU=; b=F7RAF0cDTzhez5qU3hS2IOBX7ZXwuMtKQqTsIrzFn9yq6zYqAWKF0wR3aSP1MEEdtP BVpBU1Cs9UYmpV+4716t8DRUL/FIM+H9IYV+/GwXgMGrbpX7gn6+C2KM3nUShQmg9Dun QXZDZyWcr2U1TqSiOr4hPIDAcZNqoichU3xIY15SnWonZxl357okdqjHlCu8ydFHEeIt As7az7s2EVa1DS6JIvYgMVN2imMfBaK2QzsuepFwjv2JiA1uldRZYwKLBFgA7eITh+f/ XADhdlNCTp4XyeTSYhrQ5tJHstOwfsV+78R3EoMCUJcXDkWjn2MdBNylXqgJ+hWf2UGI cr5g== X-Forwarded-Encrypted: i=1; AJvYcCUF9CTSo/OlLwtI7h7peq2YlNNQw/DGt4wDDp4oWo5dbEf+/v+vBJoF7SUjOTBk/IlAyO6WzRCidb+9Lcg=@vger.kernel.org X-Gm-Message-State: AOJu0YxzV3OOKh61Q2Eo5YOJl3zAZ2UUwKy9q8n9mHhOK/AZRtYWMNey YmcRfFDP16gHn6EZsGNEvcSoN8SKAF/91E/hRjSV+6jiHojmvootBAPQHvtT5Vc3SCW4hw+ii2N 6B9fNGVL8KZKjgKglrA== X-Received: from wmnf7.prod.google.com ([2002:a05:600c:43c7:b0:480:1bc3:e23c]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8106:b0:46f:c55a:5a8d with SMTP id 5b1f17b1804b1-483c9bb6559mr61267115e9.4.1772219126395; Fri, 27 Feb 2026 11:05:26 -0800 (PST) Date: Fri, 27 Feb 2026 19:05:25 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260227-create-workqueue-v3-0-87de133f7849@google.com> <20260227-create-workqueue-v3-2-87de133f7849@google.com> Message-ID: Subject: Re: [PATCH v3 2/2] rust: workqueue: add creation of workqueues From: Alice Ryhl To: Danilo Krummrich Cc: Tejun Heo , Miguel Ojeda , Lai Jiangshan , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Andreas Hindborg , Trevor Gross , Daniel Almeida , John Hubbard , Philipp Stanner , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Boqun Feng , Benno Lossin , Tamir Duberstein Content-Type: text/plain; charset="utf-8" On Fri, Feb 27, 2026 at 04:30:59PM +0100, Danilo Krummrich wrote: > 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? I can mention the constant name, but I'd like to avoid mentioning a value that might change. > > + #[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()? What's wrong with just making use of the C-side warning? > 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 that doesn't have max_active()? Sorry I'm a bit confused by this. Why does an ordered() compete with max_active()? Alice