From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 9848421B191 for ; Sat, 24 Jan 2026 14:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769266478; cv=none; b=W1AnIYB4ni6sswKVTMDL0mIZ7/SRNNLBxGbTMVgAPUVMkm1shtoOAvbrVIN6CANKcrCAVRNvLjowwuFOyU8XCEXV/fUTAVVZHQWLR+DhIxmENOAsZgB3sTVo1APIyr/PoomF6CdzlK+yzStmtovQ5BrgJSXPvCJjmwX/oaW2nzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769266478; c=relaxed/simple; bh=5i+McYwxhwNL7ARADohs0SCWSRYwO85yShKUxSRne3s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=eYqp1YPeR0NsZhXRQPRj5DmkMCqBa7CitNf2ah6Co1ZMYCVT1b7LNObqseP9uUVObkjxBEershI5P09rxiqQAfXzxUwx4URfauyinLPA6seWKqNwwOzN9yuuv4s/aUTPKQNCFYfL0uFU6dRzco6MxNNu4T98o/Xr9tnZ43InjFI= 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=cM3L69+j; arc=none smtp.client-ip=209.85.221.49 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="cM3L69+j" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-42fbc544b09so2325955f8f.1 for ; Sat, 24 Jan 2026 06:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1769266474; x=1769871274; 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=Aljt7hRWjvdGdfI17i0Kx5ImMNfHVYhoQpQMGch3H1g=; b=cM3L69+jQNnK18fFWJFnvKVTtbPayJ12G6oBulyJqKCaUjpds5lPpWObB6V9wbEDvV tFdewaUb9KTxx4q5Q+IeDZT32hN0idBF3ETglUfOeosru1N0HRPxfVdsFAlimc0yoosO gi0gleRr11dnjXGWEahPWHHozSMEuoIhO+XTc4vEOW7J/yHvrCq7l+dcKvy69UH1zNuc 12oCxDALBhKDqaOeTCif6XtzSP9tUbNkkRcMMGreEluSFVBb1U3J4ojRDLpScVW+w8FD jzgGpVUq/iRXRbdQukbXJbP+cEE2qgWDjFS5dD7XTRSpfx5BPdlZm7E86IKrTGd1kuUx BOgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769266474; x=1769871274; 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=Aljt7hRWjvdGdfI17i0Kx5ImMNfHVYhoQpQMGch3H1g=; b=lcshSrQjqEX+SRV2FaOnlbcOV+DTL+cy8Xq74lVwRKC6hadqMURSZ835FyJV8n6PMI krAXyl4zvFp5n5tpl1Wjkn8Hi1oOcHMIVoe+cSsHAMPDuPNG9+VA01X7Dk8YUq+nFT5t OvuwEhYGNkb/9uqn/U7eyKe7LAvazDvaD7CEsvNPbVfCNU40qRF0gtdb4Kka8QSsIBoG Y3ctOjYbiM/tIdswkDrP5m3Wq8D3LdOa5R6hIbGwzzJD1SveRnTjChUAoBGOgRbRdX3V S5ZVfjLuwD76wUzrHsi+xLfFOI8OrVVBUFXQxlEfurZT2IudmWW/6gT39LTAJDYBM2bE G1WA== X-Gm-Message-State: AOJu0YwUbLp9qVZdutXTNwqIR3kjSbcHaDh04ELS9ZVDeJ4eK/eBoMgR WytfaCPfiKSGdDZnm5jINPMIxjYYrxFdVFJDAvHWB3c6jlh/FcR4NlvT2ZlSq4d6LlZ6ehTGLRo 9YkGq X-Gm-Gg: AZuq6aKXlqI/WOGIxB3DxvNNduA/7+2j02VJxaFiWRczBhAmtb5GOsvpRqfzBUSKAyF 1kotbyKkjDXQTT4ZlTJa5KUopAA6rv/z0EZjXfxT2eoiebt8j+N3cnTqqlpS4wNgBhvBU5gMgHi ihk0wHxPZAsYnXAKofOwHd08nrv5IS3gc467f36GwX+aFZyE3k7G193CWPHWccZVLMHV8mIl+qn yS+2YnVEVVPqdkpGRxHqTc67aneiF0+SMbq1a6sksRzS2Cim7HUjeKmWC+pE+Q9P62JxrXql8HQ p5IiVCxsdCv8DF9/lEnnUTmwpTMEnCkAGuz8KNn+5Ytxqt8+vJprePi9vVS8hNnH7jSiBVgFdEE 0Z9er6MzhQjgATlFbcys/0eF6YUdOuEri9ArnPDtgYTp+2GKUIxSzpzpypgXhmRv1mbA9WWdwip 5ntJ0VMuetmTxWa46WN7LWnXE5 X-Received: by 2002:a05:6000:4026:b0:431:8bf:f081 with SMTP id ffacd0b85a97d-435b15941e6mr10267693f8f.23.1769266474472; Sat, 24 Jan 2026 06:54:34 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435b1f73855sm14846241f8f.29.2026.01.24.06.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jan 2026 06:54:34 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Thomas Hellstrom , Rodrigo Vivi , David Airlie , Simona Vetter Subject: [PATCH v3 0/2] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Date: Sat, 24 Jan 2026 15:53:59 +0100 Message-ID: <20260124145401.44992-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, === Current situation: problems === Let's consider a nohz_full system with isolated CPUs: wq_unbound_cpumask is set to the housekeeping CPUs, for !WQ_UNBOUND the local CPU is selected. This leads to different scenarios if a work item is scheduled on an isolated CPU where "delay" value is 0 or greater then 0: schedule_delayed_work(, 0); This will be handled by __queue_work() that will queue the work item on the current local (isolated) CPU, while: schedule_delayed_work(, 1); Will move the timer on an housekeeping CPU, and schedule the work there. Currently if a user enqueue a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to schedule_work() that is using system_wq and queue_work(), that makes use again of WORK_CPU_UNBOUND. This lack of consistency cannot be addressed without refactoring the API. === Recent changes to the WQ API === The following, address the recent changes in the Workqueue API: - commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") - commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The old workqueues will be removed in a future release cycle. === Introduced Changes by this series === 1) [P 1] Replace uses of system_unbound_wq system_unbound_wq is to be used when locality is not required. Because of that, system_unbound_wq has been replaced with system_dfl_wq, to make sure this would be the default choice when locality is not important. system_dfl_wq behave like system_unbound_wq. 2) [P 2] add WQ_PERCPU to alloc_workqueue() This change adds a new WQ_PERCPU flag to explicitly request alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified. The behavior is the same. Thanks! --- Changes in v3: - rebased on v6.19-rc6 (on master specifically) - commit logs improved Changes in v2: - rebased on v6.18-rc4. - commit logs integrated with the appropriate workqueue API commit hash. Marco Crivellari (2): drm/xe: replace use of system_unbound_wq with system_dfl_wq drm/xe: add WQ_PERCPU to alloc_workqueue users drivers/gpu/drm/xe/xe_devcoredump.c | 2 +- drivers/gpu/drm/xe/xe_device.c | 4 ++-- drivers/gpu/drm/xe/xe_execlist.c | 2 +- drivers/gpu/drm/xe/xe_ggtt.c | 2 +- drivers/gpu/drm/xe/xe_guc_ct.c | 4 ++-- drivers/gpu/drm/xe/xe_hw_engine_group.c | 3 ++- drivers/gpu/drm/xe/xe_oa.c | 2 +- drivers/gpu/drm/xe/xe_sriov.c | 2 +- drivers/gpu/drm/xe/xe_vm.c | 4 ++-- 9 files changed, 13 insertions(+), 12 deletions(-) -- 2.52.0