From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (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 BDE5E25BEF8 for ; Sat, 14 Mar 2026 10:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773484493; cv=none; b=Kla9NXOhXKXvFuJOfQ5hW2PKJ15nEeElKAqh/K5JsCnmwfPq7ck6ZWZBlwDMuZoh/alD4ogHPs0WTutgkFqYs8v03MmHbioFTe1GvKi62RZk3dZ2IOeTBmjZ5MXE87VC5bvDElZaadQ/jniIRA8/8E6wtfFsFo1nqIkBVGyElyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773484493; c=relaxed/simple; bh=8pYlSTWQj/4mT7nDcR8AI6HrGlb8wLJXUFirubyysyI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=bT5EUjnmQNZOZy7Yq5QaV62dSMGnaIi0TsadFbGKdAvottpB5IvPL20BAQP2M6GrDdYR6wcfAehxPy1CDkNHRAb/SPEzTdiKn6JhBA0wnDWV2jgHFOLlg9BzPaDUScakOu3JHCZUDzV03+2sVcLB2OMDZs0OviN7si7YI+ku+IU= 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=Si1o/QeU; arc=none smtp.client-ip=209.85.208.73 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="Si1o/QeU" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-6626561fcdfso3167682a12.3 for ; Sat, 14 Mar 2026 03:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773484490; x=1774089290; 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=Gk3LahT7LBtCClNQfo/eYL9ZNEAl8jXw+YpBWkfN1uk=; b=Si1o/QeUnvOxSMftTZw99EJLwZQR/m3xt+ON8SvmJeM4L3hgnX3r1kx5si+TEGSd/P V2izA5/NU3IsAIaqSAVIDkCdynhpMBrAgXXhIznG1U917KsXV4oeORmMJpZbn99SFaMJ +mEU7otf1FaY25U91taSPyde4egOcNX+IvXvneazrRPFATwngcK+pChqQ8va0nplcW69 KcMyVXn3RBeBAKohBnMpdSFdd7GhvEgSQxuT4oEFyIWszv2wYV6dho4EUbKNWBgqYVbL 7aMYNSjryy9c7GBovhDK11SDWqicZofzWtT3sYnBMs6TRonjisxWlwdeuZcyxxgGWfK5 5gjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773484490; x=1774089290; 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=Gk3LahT7LBtCClNQfo/eYL9ZNEAl8jXw+YpBWkfN1uk=; b=c7K47XnRAcbtZOI3XHpFh1rq4Rb7XviHg5gEnSD7fsESFoguCIx8LCFcU1kOeeLIFo 4v3bLZNc5vMAAyxsDZJ/MzsDro/Tr0xiY6UOfdJHFxPDWbILdJHy+qyZX0gFx+ke56aw OrF87QTkbqQnJBl471qjZe6pwp76PxgAGPVmKcWIj2yNkJpAP0wW06fRTJUalUdJhoxJ lw1Qhsv7y0N8+NjtJmWzIk21zop0Dp5YFvxJFDQsXqZd1U0o5N2UzETfspwyeIRcAdco TPCYVGQTc9kKw4BDS/pw+rNDeotqyIfon1VtyxEGAjYRr7rq6oRjk+D6GUx5vOWb6YQD fu6A== X-Forwarded-Encrypted: i=1; AJvYcCXFgJrVkps1hgKHkDY8T9wsyDaxB5vocsUmR/ZRkWkHDQGCHbhaKJ4Q3InlYxYjOuguqWezDpsy2n6cB/0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxvu511RZ7NbZDZH9Uafdp3YJlSJLTVQ8MkYJIX0gm20VD1Cq/6 JIMUe3VV1dYx1AfFBog6eDFBijMJxCIksvuaDXRtPiDlH4ldC3evSCQ+6GFhyi79ylUQr0ZXmAI T7ERI2dZyknN7jSg57Q== X-Received: from edev3-n1.prod.google.com ([2002:a05:6402:a2c3:10b0:662:a1e5:d213]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:3642:b0:660:f443:379a with SMTP id 4fb4d7f45d1cf-663babf5c95mr2712492a12.15.1773484489676; Sat, 14 Mar 2026 03:34:49 -0700 (PDT) Date: Sat, 14 Mar 2026 10:31:43 +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: <20260312-create-workqueue-v4-0-ea39c351c38f@google.com> <20260312-create-workqueue-v4-3-ea39c351c38f@google.com> Message-ID: Subject: Re: [PATCH v4 3/3] rust: workqueue: add creation of workqueues From: Alice Ryhl To: Gary Guo Cc: Tejun Heo , Miguel Ojeda , Lai Jiangshan , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Andreas Hindborg , Trevor Gross , Danilo Krummrich , 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, Mar 13, 2026 at 01:29:41PM +0000, Gary Guo wrote: > On Fri Mar 13, 2026 at 1:25 PM GMT, Gary Guo wrote: > > On Thu Mar 12, 2026 at 10:56 PM GMT, Alice Ryhl wrote: > >> On Thu, Mar 12, 2026 at 04:39:00PM +0000, Gary Guo wrote: > >>> > + flags: bindings::wq_flags, > >>> > + max_active: i32, > >>> > + _type: PhantomData, > >>> > >>> Hmm, it is somewhat awkward to me that we are having a `PhantomData` here, > >>> as `PhantomData` is documented to "behave as it it owns a `T`", but all the > >>> possible `T`s that we use here are uninhabited. > >> > >> I don't think this is an issue. > > > > Fair. I also don't think it's an issue, just awkward. > > > > I would rather make the uninhabited enums be just unit structs, though (like what we do > > for atomic ordering and device contexts). > > One interesting idea with unit structs, is to allow the type to be passed in as > argument rather than having multiple new_ variants: > > Queue::builder(wq::TypeUnbound).max_active(..).build(...) > > This is the trick that we use to make atomic API looks nice, although in this > case it seems that it's not worth the hassle as it needs an extra import... Yeah, I don't think this is worth it at all. Alice