From nobody Sat Sep 26 07:15:22 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 E374E4DA543 for ; Thu, 3 Sep 2026 15:22:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448981; cv=none; b=DLnZnffXaLXz0wVxsGGqDT89575TM8hoGfW03ggGUVEWBGvD63d9xbLYO8JaOt+rCFtBH1dV0AAp78qJTydjTp35jMgxoZ7RysJkWP1XgtitnPuSkrB1E0vjY9pCOXd1hp8nGufpL388roSW2MehFRAtQMUPVND9uPMY6Ts+lks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448981; c=relaxed/simple; bh=WdQvvlXMHNopY09CMyQCSuEacColb45jXilQsgXt3d4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tgwqz2RVgjH5Dh+jT3k+6iGDttgccWSxHoevxM3sCcla6aDpwp/UxStG5MdniLY1z/cBq048b3vaU2Cs6k6TScAMlepLzL6ARvot9T7yQK9OwHg7uBZbWpJdvgY2GXM+oEQVHTuCF0rSPrsAw/L+xY/KkjpuZ8HtVenHCwa70ig= ARC-Authentication-Results: i=1; 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=Hf2VRhX9; arc=none smtp.client-ip=209.85.221.54 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="Hf2VRhX9" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-48436216a98so1608037f8f.0 for ; Thu, 03 Sep 2026 08:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1788448978; x=1789053778; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=l9fxFfAJcOejAOccFioTdZSgoVChkZbm2FvtNGTKlno=; b=Hf2VRhX9HxAvCT5JYuX1unTvKSCoxg52l9Q+jgvDCNIfYjkPUTHZE1VMFHFk0SEHxV r+EUx+qIDTOsnxGlTyMGKPguri4qN4hZ9cbyf8z3AQ6H8HCe57zTxIpT5mgXC0X0EYmb /zgOqcZ4zndvDpjO/XQWLzA/RdWWJebmjwrTmFA1xkuLWHkZdviSyBltCN6kbs21N3/j FKylXniJStRHNl+pVRE4Z5ocojewh071AjSX09DxK4WBefkosqix/8XGA8MDOcO0AqQA ArsF5GLMjxoU3kCbEo/JEEEno7SLbJylNG31aFJ/j/TEyL1yVmJmmuXRxXZuT/j4aBNv ds7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788448978; x=1789053778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=l9fxFfAJcOejAOccFioTdZSgoVChkZbm2FvtNGTKlno=; b=SL4XOQONH+6l4vJg0PgNzqMKD2Nd/Hnxn6KGVXs1kh5Z1B53VRZBYZwmuV6nAFI4ed qS5rkKahpl4nVrZDehPDEnV1czzkb/E0eq0z5B/3wRdD4zRZV9GCqzRSLpfM8NnXzu67 +khOi3VM5id5V0fl5EtJWePC/pumCiedMSy66+xZSzhUyoTkFvG4U8FgqwmydN+Ov7gI DtBHz+h6W1GqnD2ww8AgPGcKuXFjfDoKewwghTuG6XLzCZ6gu4gVpaS9l5i9QuTxBsXr M1JscYklCU6CRp4mLGIoqxJ1QSGZoz9FwR/K+e/cy2Cj+XSMgwqMdNdHWKDtFvM5DuTu RZ9A== X-Gm-Message-State: AFuF++nskvRqS5kea1vvlcWCW3tX3KlE7A/5JIJm/p884PN79Z7Bz2V7 8XE9/xXTrnFfKu+Y5Bay5PtLjrO4rGegHWSEoZ5fsXXrARtf6m7M6Vom75nqjqSnbxg4MY2uoU5 YDxzdxLc= X-Gm-Gg: AYBFou2Wg3xb9zM24kMDWNqNH1eVy+plKo6FrUEfX5eIrBK/a3JDDGD2KkJqmhdGhyY dMSYdgaLCSyNuhcXPt8FEnRKBrkOq2zceEJxZTG82d6KeYwYCfj1YI6tfoefpbg0fQRjzhTPUiH CmwFlmtOQp7uL4pHQrt68eYBN/XffPcmIGTnkvsBKFtEDV6imwPUcXjO/oQEeRj1OT4GKIbfdTv vL3llwuZTcIswbAFo/At/OBw3EXdX6Yzyd/Ukuan7LcMSPXm/K5d3tJiYDkUZxALLTIuURbWRBi 1nhvPvh5c4hs0z3fmnaf4u3KdCM+kqGdpxm65czqAVwTLT+fKSQ7PDdPY/dSHb7gwRfGt0juavi dR23ZR1pvvHqPGrPl0YGxVEdiOgw/rwd48cDMkIDZXLuvC1xte35fCxswcm8zpHiAF/zbm/KEJt poFvvKYbAL6E60R02oxtiUQNjv7p0L0v0rfXJ/8WiXVjwj5ARPSlfvgujD9gX//64xoEK+ X-Received: by 2002:a05:6000:4709:b0:484:3317:a19 with SMTP id ffacd0b85a97d-484914cce06mr26492189f8f.26.1788448978144; Thu, 03 Sep 2026 08:22:58 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48448e13db0sm14648114f8f.0.2026.09.03.08.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2026 08:22:57 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Breno Leitao Subject: [PATCH 1/2] workqueue: Make alloc_workqueue() unbound by default Date: Thu, 3 Sep 2026 17:22:03 +0200 Message-ID: <20260903152204.401638-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903152204.401638-1-marco.crivellari@suse.com> References: <20260903152204.401638-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently alloc_workqueue() ensure that one among WQ_PERCPU or WQ_UNBOUND is present. Now every user has one among these two flags. In order to achive the future goal of removing WQ_UNBOUND from the code, start changing the default behavior making alloc_workqueue() act this way: - if WQ_PERCPU and WQ_UNBOUND are present: remove WQ_PERCPU (as before) - if neither are present: add WQ_UNBOUND The WARN_ONCE() when neither flags are present has been removed and it has been replaced by pr_warn_once(): from now on, every alloc_users() without WQ_PERCPU will be considered unbound. The pr_warn_once() will be removed along with WQ_UNBOUND in the future. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- kernel/workqueue.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 1ae3732a2c51..8681343597e8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5928,16 +5928,16 @@ static struct workqueue_struct *__alloc_workqueue(c= onst char *fmt, wq->name); =20 /* - * One among WQ_PERCPU and WQ_UNBOUND must be set, but not both. - * - If neither is set, default to WQ_PERCPU - * - If both are set, default to WQ_UNBOUND + * Every caller that doesn't explicilty specify WQ_PERCPU will be + * unbound (WQ_UNBOUND) by default. * - * This code can be removed after workqueue are unbound by default + * If both flags are present at the same time, WQ_PERCPU will be + * removed. */ if (unlikely(!(flags & (WQ_UNBOUND | WQ_PERCPU)))) { - WARN_ONCE(1, "workqueue: %s is using neither WQ_PERCPU or WQ_UNBOUND. " - "Setting WQ_PERCPU.\n", wq->name); - flags |=3D WQ_PERCPU; + pr_warn_once("workqueue: %s is using neither WQ_PERCPU or WQ_UNBOUND. " + "Setting WQ_UNBOUND.\n", wq->name); + flags |=3D WQ_UNBOUND; } else if (unlikely((flags & WQ_PERCPU) && (flags & WQ_UNBOUND))) { WARN_ONCE(1, "workqueue: %s uses both WQ_PERCPU and WQ_UNBOUND. " "Dropped WQ_PERCPU, keeping WQ_UNBOUND.\n", wq->name); --=20 2.55.0 From nobody Sat Sep 26 07:15:22 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 449624E13E4 for ; Thu, 3 Sep 2026 15:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448983; cv=none; b=LSnrWTGC437LrgtOq/QzDZwV53Oyfg+yy/HrmbK0HN0zwYDDzlZfxxBGL1DR1kOtXjLw+/PDmRNeZqY7Uw8ZRn+SujLowBwk4vG/Xsf8lziydzMK38Ul2tPhtcuUdmE8SJF+IgmhggF+Cn7/0sqgyPx7xSt8qjrsZSMLAoRxuMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448983; c=relaxed/simple; bh=DGn209hkaWMFOjkQ83re+KwEpJGKoTo3ez+Bt3Mu1Zc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pHtsgr6iJeEFPOoWo7XZQi+ZdVouR0H4K2tOwYcQLKAoOktToV/3ZtmuTbcha5D7y40MVtQqv5GZ1npHIspPr9w3fQFBHJZ3QNtEMZf5wl8NOpW3YdtyLuMFiHpqYvqY9+bZSYxc/4GSivQWZsMDfsPPhvs1G2L75o2bbFTW+NM= ARC-Authentication-Results: i=1; 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=WPZX9t5l; arc=none smtp.client-ip=209.85.221.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="WPZX9t5l" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-482e4998d28so1863847f8f.2 for ; Thu, 03 Sep 2026 08:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1788448979; x=1789053779; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z6Qo+0/1udSWJ0STlhhWyqGdrWWVT73HGXaXcBOH950=; b=WPZX9t5lRbdRTBWIpUdSIyOVOeFBcnbMayjrIVuKpfjYpcO4fHcPJlWNJk9YvtBhzY vxVzEywYuL7yNy/243yL+gYDH+fkig55mpCS9xSZs44cj4o4UBj3L8wqy6GB9HpROhRu h/GJV8taYBCH5UnAKD80gLciMcbQSx5/gBxZ53EEg6g6gKVGzLhQI1dEzXPbuuFOjkTQ GWPSSkxqq6ucc0e4l/rgKY3g9jm7lmRjKy2Kw+8Ud3a+2ISxfo3ENN6ORTeSksVxPljf DOnaLtkDEZjbQ9zgvfMyTGfSpO0tVAbXEpy6XqOIn/vtCH1LqsBB3h+oNSb3FFPSG1yN vzTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788448979; x=1789053779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=z6Qo+0/1udSWJ0STlhhWyqGdrWWVT73HGXaXcBOH950=; b=Gq7y1J1KRKlTfr5V0s+J9hmeN9mR0080qpeUURijLQ2/LxtsautRkGKU1j1c5k/hVR F/gKQ1VrfIwy/Aow10HGAO5zxM2+AnlqJStZvamY4DHO9njchE+8CmB1zz48Wg+KsxUc IHiJu79nbg80QtRQh0voRKT2l2a5YEPPL7pvaawbu5mNsYkUqd1R7x5PNblXZlk7DEI0 uPUDRAIOEHFMCKD4JIeRdrX7Lt4xSHLmMu0EOkYguLTm3HIwLEb5ulQgKln8l2cxDeQs QLP4oEbmZ1GGWsrg+8u3xHD/wWIe0v4laX46vaW5Z5NK4ESuNLDzt/A+eaUQVnAqK/LK iPhg== X-Gm-Message-State: AFuF++lKTGiyEHYQg++GiybQfjrDzJ0D1o/PSML7kJOx0Re4lSV7zrNG zwmVcBYJyjumBo/LeMchWbCp3UzNc6feU/RD98t1lXiDrQAfdC3zSsa2E8mzqu3diIl74TnvpgV 1anbDYco= X-Gm-Gg: AYBFou25GictKmSaZyxcyQ0Zm7uUc2uu+sDhMksC3Rch2cJAy4CzTfEj5YB0jbVB7+G 6tWpvpIYBlQjx+AN2tMJrLXzX0kOfImK/1LXf1FIgNG7Y6BLNgZqZqMgEQtIltniC/rVEzyU9b2 IXmAJkod7WfZw4jWOQyWzzPdi/aFSUoTTrQIrBqWjUdurB9kmxBFcjnJzp/zIKi9tzdYa8dEjiZ T5klQs7oMwzLWE3rImT3NJk+/dCPPWUvl6pYOs3si82rn5vAKM03ytNCCAG+pWedi3L9GDvPszY NsLdsX2evG/e5F0Teco1dwNkzRMHs4U08K6zq6pYGXrWwZ63TyK+6yisWB3TMLZ5vnGr0nDhQeJ Xfe18AEYJxrTtx+d63Ew81rilVQLe5u8qViLo9wgKuq+28XHmh4JN4oT4V7FvzTgyw/UCH++uWU 7VIMz3LtQ3H5klsmt2J4s2hJrC098zB59751+XvZPn+Lp9X/2iDlEaLHfX/ngkE9ExmoiNJIlV2 VflqwHVJTo= X-Received: by 2002:a05:6000:46da:b0:482:d9c0:ff19 with SMTP id ffacd0b85a97d-48586034836mr1701340f8f.9.1788448979145; Thu, 03 Sep 2026 08:22:59 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48448e13db0sm14648114f8f.0.2026.09.03.08.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2026 08:22:58 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Breno Leitao Subject: [PATCH 2/2] doc: Update WQ_UNBOUND documentation Date: Thu, 3 Sep 2026 17:22:04 +0200 Message-ID: <20260903152204.401638-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903152204.401638-1-marco.crivellari@suse.com> References: <20260903152204.401638-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When WQ_PERCPU is not present the default behavior is now WQ_UNBOUND, so update the documentation, reflecting this change. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- Documentation/core-api/workqueue.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/core-api/workqueue.rst b/Documentation/core-api/= workqueue.rst index bb770f556568..3ca636e065ef 100644 --- a/Documentation/core-api/workqueue.rst +++ b/Documentation/core-api/workqueue.rst @@ -206,6 +206,8 @@ resources, scheduled and executed. * Long running CPU intensive workloads which can be better managed by the system scheduler. =20 + Workqueue without ``WQ_PERCPU`` are unbound by default. + ``WQ_FREEZABLE`` A freezable wq participates in the freeze phase of the system suspend operations. Work items on the wq are drained and no --=20 2.55.0