From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 81FDB3E1205 for ; Tue, 5 May 2026 16:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997832; cv=none; b=TWGTxWyDD4h9alCBwllQo57WYlucpIvVKetkqBHQQh0A/dT93Wg4nN2szNA/AeY9ZcqOOXGoF8VNptwc3hfv8Y5bld1ycheiaw4EkbU+AAONFaJ5wdj7/4L5vJLvXqSxTc4+wxE4Ra84mF47jLpVQiXJXHFe1+TzutpacrbMxGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997832; c=relaxed/simple; bh=Jbm9C0LWlFBBQfA5afMVKh4I86AtR6iX7qvRYgtZPv0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T3Skr7CimtFFHHAWAJk61EOg++svrpBhEwHZ+NpHt/KhprmIjCrI/YKmustWxV1sPKA5WJhs9siyhhXZjgrlG8bQWiyf72OLqMpq9Too+eBB7pEHCey1cZCtOVkxG15x3j8uyH5G+4NvYZ1RHxqZxVjLIgDmdrIUBdee6b+xHks= 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=P9uS/yC9; arc=none smtp.client-ip=209.85.128.48 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="P9uS/yC9" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4893940bb5eso29952335e9.3 for ; Tue, 05 May 2026 09:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777997826; x=1778602626; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ahjhb72C5EOUbB4JMo7kcPpO24sJtoaszYsYqBzAh2I=; b=P9uS/yC9r9kwoUstppeZA9WYMXbSCFJ1VGPlw09g4QViUof1Ycfj5AJym9e8Rvil08 LkyUWfTTqA2ZkA715/cMNGeW1tnc1vANMnLe1dJAK6GxkZKtN3y8pJsVHVyrwRf3NX1I bF3LUvhx3JdXV51NnqClNoCLOKi0Inse8szI2L1tHxYVKqnK1pfQUIMigiVt9wQdTVwU 0g9Pa9LvK0/XDJac+APnSWzH3e6Tf75QRrr3vApwT/O+SgQd8EyblNsYKo22eeRMY2RT DhRx2TKmJi5hPqpMCUJREWCYcNVZy73IN/lwIpn4usH9ezxCl+zcmBkTGNR6sxmkR89t N5Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777997826; x=1778602626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ahjhb72C5EOUbB4JMo7kcPpO24sJtoaszYsYqBzAh2I=; b=ZNGMK0kdHsY2IcKPv1TEXJHyN5pzsS/p39XBU3KP9/D+2EIxYL1tcvtY9KsAHOgykI CwduHZhENMEpHpqamTX4Wn365FUl2f2O7oj15PBcIqS7ErkFQpaSLb3dlIvom123mRR6 aoScB8Ku9gSelstPjoyB0Ahiv02/AiULop0725EoTDIRWjyMot8P9epCR6NUAT4jmLjP SS31fxeYLW271cx98Ov4FDnQCFhibD1oMK3pfFbGISacf40JJ2KJTnkmLlUNjkgF1SF1 LxyrfND5+FRR3vBrBfyxJMkmCyAOwgm7UNkac9LvMGZDcUdI6IIbDzNfqIqEGGoLjSvb D/3A== X-Gm-Message-State: AOJu0YxqmCB6emFyzkB0zXx0soaKW1oiCmXwcrhFND8kaEC41PdQJfvI Y/P/gPE4fiy2Ek7bll1dHLVYrwVkF1ISt4vqwprl4zijzONYhTOfJ4nJO/rsUELYZlxJZHCj+Hr tqWXt2nU= X-Gm-Gg: AeBDieuYpcpxM9yhFbJichEV6XtBPVa9gRDz/D8jPBhr3ImOHgYwzgcntDzOZ12q/3w Ih3H0tqA0ylJaBnqXfbYfyC08tmxzx0Pb5vdUpf6UpFlrXeEATKUp2H9xayIRPYG34DP0YMqv17 KJeacQhMW6znKvEGTTsxJQF1lKeHVOeNmQba40R/9ErkcEmmD8EzLuLsbN/k5EavcHiZfYZ1fCx NKv1qC9DNTV6eb/Qp/MO/IIsu7vlh234oPidZhkZ/aVbZiC6YnKmG+9B2EE8XR6vdjTNZmrq/pe /ChGquZ9Grsj8FyocnbLFvizIzqdm5ZrFAFjBoxx0AyC489CnVkQwuS8H93bGx/divwn6xbLiKM fuXsTG20tsbNxr2IpGivaPX8hbJL93NpnnByyDjLyyzBuBFSgujnXcR/vMSxf/s742G43mRMI6E QVTciUoHfdY+HS+GFZ/JFbLV2nL6d2M6Hg6hb9+w66bo5ULwDn21V5W+ufvw== X-Received: by 2002:a05:600c:8710:b0:489:1cd2:610a with SMTP id 5b1f17b1804b1-48a9887194dmr236766345e9.9.1777997825594; Tue, 05 May 2026 09:17:05 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a82301adesm400997535e9.10.2026.05.05.09.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 09:17:04 -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 Subject: [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag Date: Tue, 5 May 2026 18:16:56 +0200 Message-ID: <20260505161658.401998-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, The following is part of the Workqueue refactoring, and a first RFC about the rename of the schedule_*() interfaces along with the introduction of the "wq prefer per-cpu" workqueue and workqueue flag. Any feedback is more then welcome! ~~~ More information about the reasons behind the workqueue refactoring can be found at: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Actually schedule_work() and schedule_work_on() enqueue works using system_percpu_wq. The function name doesn't suggest it, on top of that, only the per-cpu version is present. Because of that, the following changes are introduced: - queue_{bound|unbound}_work() as future replacement of schedule_work() - queue_bound_work_on() as future replacement of schedule_work_on() - queue_bound_delayed_work() as future replacement of schedule_delayed_work() - queue_unbound_delayed_work() to offer the unbound version - queue_bound_delayed_work_on() as future replacement of schedule_delayed_work_on() The addition of queue_unbound_delayed_work() is because "delayed" functions make use of a global timer and that means the work will be executed on the CPU where the timer fired. The Workqueue API currently do not distinguish between use case where locality is important for correctness and where is important for efficiency. So introduce WQ_PREFER_PERCPU and wq_prefer_percpu_wq, so that works who need to be per-cpu but don't strictly require it, can use such workqueue / workqueue flag. Thanks! Marco Crivellari (2): workqueue: Add queue_*() functions, future schedule_*() replacement workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wq include/linux/workqueue.h | 108 ++++++++++++++++++++++++++++++++++++++ kernel/workqueue.c | 6 ++- 2 files changed, 113 insertions(+), 1 deletion(-) -- 2.53.0