From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 BB25031E82A for ; Thu, 28 May 2026 14:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.167.43 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779977658; cv=pass; b=iRZN7bPWJ74HUJO4ZMKKdL2hE5N1sB8aZZlPByTiXYjxZ8X7DYs++lcBiCz2DS6IrvHaOJZSGNGCtrLiJ0MtsVdvU89XZc5uAMVFZG8o1tFdbHcqXhmJ8ximmb3mCTHB69N9h3BsfeUEb6Yv/w2a6lEhNJPFIz+QBNw/vaaca4s= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779977658; c=relaxed/simple; bh=EV0teRbkn8RJcOv2Q0g9je/Nt1hSyvMDSFMMYV05f1A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YZtLofEsv6p3LNnVBIpbgBEkRMnRzQMx3USRNP9hR+D0paGbrAs3iGx5eWRPpmkNGFR1/YRdHQs56mgBe49/d+KVZzA5Vqhwg2hn3N9UxWr9Z19OnXxXoNfoR5Xu/ziBh/uuKEH9YWu8bRXzt8WNvw3awdDoZ6AT6pQR8B/e5+8= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=e80Xr43M; arc=pass smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="e80Xr43M" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5a995ab70d1so15170306e87.3 for ; Thu, 28 May 2026 07:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779977655; cv=none; d=google.com; s=arc-20240605; b=THvNdWYfqUl5rTQG62X5uQbXQasoCmohm0iHGaRS/u+s1Xpt1s5yCvEcnjdUjn+jc6 6amfRjwwbpqQpek5fiL6WmTGmz2lxsTgJY5h+fzjfebOrr1OlsOimVsdl8Ui9tt902+r C/69ZVJONChF+sdo9O2R+XpORs7Y6xd0I9g+4ZcvC6QLY8SVZ80mzeXCQ5PPXZnFrFpz TchNIem2Z/hFs4D0m+ZsfvLQb63LXYalDW7BE6qZprYvhcq3ipXjKD0KKJeF+8nfKKri I/MBpCErG2Y9HiaagAKwuBHVr5KLGA7wAftAnPIlI51piSdVsBI8fRQ7h8u+NbKpBN4i hL0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OMpXGRPZtqwty4wmEuVzIW54RgP9uqQHVIKcUju2K30=; fh=wqpym5wdywHKX1k4LfSuYEIgziUVveNNjJlYs87qQ4Q=; b=eenRiq8LC0lbgepJGo+vo+AfCL3sfEf5IVK35fhLnuoT5Q/g6hV8vSEDTQaxJWFbXK PSH2lKuBYp9klN2N0xFsAbJm/uIycgE+GHFDOszoh+F43Rji6EsKYC8z5ejBJpysbKtv 8NL0R5mgt+E5la9RanXHXbyyAv3DEP+FBNbqBItBdCPDz/0SylTtxlvYgFTuMWG8VGqE x4HoYzmIgdIACeCO9i1UuZabKXdpr9ZxmJ5lIbFdbh4r9CIubiCwzfEh+fozKvz+awKv tqq7Tqrk6Y2GPfkYoMhA/ipVhrZRI/vB6DxAUbg2eUVb9gR1f2jDzTCTQekrqXwNTwrW Er0Q==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1779977655; x=1780582455; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OMpXGRPZtqwty4wmEuVzIW54RgP9uqQHVIKcUju2K30=; b=e80Xr43MgtqJ7gdOcWpX6QbCD4v7UXsnmwsaA+3gOfJAlneLz+27vV7iS0ZNKVj5j5 KW3zUh1snTHg+mDehtR8mVCsnDA2xMCHHqzOw6jXaV9Bc2A5m/JuzpcKwEV041BaorKa 2kcK9uIc99hQp4VJkB+MR5HHOzO1RV9+vKfW8zabZAX7pYYG5EegB9K6JF0ArH1UgA1L dhRNPUatHJKXjGdCHH39+N6kH981vAmKjGbTOLb2u0AlI1RZQrGIEtWoPPMrDN1BT0Vx cBSiwz+YKIDM3EGVxSR22ehNt0WlpyNofKjyO9WPJzXW9do3ZjFzpCDhqzjKsZTZ/OVD KIog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779977655; x=1780582455; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OMpXGRPZtqwty4wmEuVzIW54RgP9uqQHVIKcUju2K30=; b=BudJ0ezRDbphWEAmaL/Q02bLfMvV09KmLyP9cl27anjuP1DzwJOlOr0jkopB8mh9AE rCIfMV/X9IyfiiJfHt/86BWG5UtrsZLS5Fap8zn1ohZuV/N5r78WPBtqixDPNb/32HIz HIdBblW17EHSzRIdBJZQkUf4KXURX8JCN9tLUY0umlD2HxxPZnyVTgrrURP4NOVwjG5D MUaWBBrMuYVQTAl0DU/k/9onBO/QKzGu1hXj6LjSwgGmVUM7Jkmgf2XGsooh6IZzIK/t RB5Q1rkoKNcEn95B6FMsvlfUTGTfq6hOLfgSlBw86WDcVcOgndX5Qnh6OxVwybLgW60Z 3PVQ== X-Gm-Message-State: AOJu0Yx+nI+oAYnvk1LhWQhk+veelQiAoccS/3jMdvjym1bOwyQHamJG IDE9q1LD2DrxFnXAtMJ1invF6GkeQQYVHGQf/OFkOiLhwpx2+nQwtliXFbyNOC7BIK95ZLohDjY fUjFk/cFTGuCBEJFexM3vRcUGNF5P7uwoA715qZ4Urg== X-Gm-Gg: Acq92OG5fR/6i4J2pltbK1oLqBY1FDREZ60ks/rqwzYz8+nP1X1Yyfnk4QRKbS+dYdE 2Z5si6fpiS6vIfE4UGEOlO6HStuEHNq1gH0QLjaenhpo8qkBFnl82WbhZTNEOVeMwM4OUMUkDMB O6mwkfaB4Lr/2/pokeTLbsyEnbqbYFx0e2XbeZZpvT7JH7JH7/Puhupj0q8qyAwz3xnWNsm7nR9 cVw01C+rgBqmTxF2h1pbTevkcZS97KcQILtkUOXqGG5NBwRgIx2HXXByRR/z6k4AnGYnFWDF0iM WZ9tZAWivkyeNrUBcyyQBJDqgSt17WpdEjVwXkPUtG8RoXiWO8s= X-Received: by 2002:a19:f614:0:b0:5a8:d1f3:501 with SMTP id 2adb3069b0e04-5aa323d4911mr6443273e87.22.1779977654794; Thu, 28 May 2026 07:14:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260526150041.365392-1-marco.crivellari@suse.com> <20260526150041.365392-2-marco.crivellari@suse.com> In-Reply-To: From: Marco Crivellari Date: Thu, 28 May 2026 16:14:03 +0200 X-Gm-Features: AVHnY4K4QxDuBofLlP1_93S-CFQiV9VJDuTS6gOt-qXEHzWHwev7QwVPP-_4w1k Message-ID: Subject: Re: [RFC PATCH v2 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used To: Tejun Heo Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Michal Hocko , Breno Leitao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 27, 2026 at 8:32=E2=80=AFPM Tejun Heo wrote: > > Hello, > > On Tue, May 26, 2026 at 05:00:40PM +0200, Marco Crivellari wrote: > > Currently many users transitioned already to the new introduced workque= ue > > (system_percpu_wq, system_dfl_wq), but there are new users who still us= e the > > older system_wq and system_unbound_wq. > > > > This change try to push this transition forward, by warning whether the= old > > workqueus are used and redirecting them old used workqueue with the app= ropriate > > new one. > > > > Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de= / > > Suggested-by: Tejun Heo > > Signed-off-by: Marco Crivellari > > --- > > kernel/workqueue.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 72 insertions(+) > > > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > > index 33b721a9af02..e17617e205b1 100644 > > --- a/kernel/workqueue.c > > +++ b/kernel/workqueue.c > > @@ -2437,6 +2437,24 @@ bool queue_work_on(int cpu, struct workqueue_str= uct *wq, > > bool ret =3D false; > > unsigned long irq_flags; > > > > + /* > > + * NOTE: These checks are here to assure that no users will still > > + * rely on system_wq and system_unbound_wq. > > + * They can be removed along with those workqueue when the > > + * time comes. > > + */ > > + if (unlikely(wq =3D=3D system_wq)) { > > Can you add an internal flag to mark the workqueues and use a helper so t= hat > the warning messages aren't replicated in multiple places? Also, do we ne= ed > to have the warning on delayed_queue? Just put it in a single spot where > they'll all converge. Hello Tejun, That's maybe a silly observation on my side. If I remove the checks from where I placed them and move them deeper (__queue_work() for example), I won't know how to print the "caller," making it harder for people to understand which code is using the deprecated workqueue. Printing the stack with dump_stack() is not doable. Do you have suggestions? Thanks! --=20 Marco Crivellari SUSE Labs