From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 5C7EF29E11B for ; Mon, 2 Feb 2026 10:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770028689; cv=none; b=ovr/ZCfL7f2YrZyqrAZcNcGlP5SaegGbpt9jtJ6cfHe/vh7/1sEGFNTq7kaRw3RnBLlSeKgYBDYfrD0/AoYlzljcFqsRwHLPhePwCIAwOCVa1ES8w/bbh5CGFbTTq2Pa5SxCaapVtHMwT0GcKsiFXoZO+rxeAtiGTSvG2I+ERCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770028689; c=relaxed/simple; bh=K0uJ0+M3IBE0fWIllBpdJWJl02m+peccQrYyoRUo94U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Q8+/aTp0WGIygzz3N08hW7Apg5rjAJgUJvztbRgQ8noNrSlmtJSL3FgdWy4UXYdekjmlFTP8LOXe7VwiLbkjx5GZP0bkGhIypMkLJHSOOrcWaofv5CCWUQ9hneq5FQVy1tnLsA0MF4zzAGP8sOYBmL+YzdhVmfCeZ84tUuIXN10= 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=EOnfFffK; arc=none smtp.client-ip=209.85.221.44 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="EOnfFffK" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-43601e96f72so782460f8f.2 for ; Mon, 02 Feb 2026 02:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1770028685; x=1770633485; 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=jxwZvnhF3oQwannNLGicFGTT7cRyzihZn9lUXOj4q18=; b=EOnfFffKbXLzmO/53vkhowvzvhWPbRnwqvb+J6HdshlXudFOhOQ0Z7Vn4Bswc/YlWC P5iY5062f58jAHCFHhuILttXSYAEl6tXECnLN0k+24nUuAR6x9KW8LEwYS+dUUenyJfW JJEzNxsCQr2rn/I7rU4qzfbGrIMEce8aD0DfB9c7f4PAxRm+RCxIvie7jPMllGvB4NNg B6Cbn+aBMLpDmyOPoz+FjE8/rumREYXNw8OBWE5BnZ7V2YGvjP+/EfqLzf6S8kPi48IM yS7H7auDERGBxPBP9ocvaYjBTKRgKTrs5IwHpi4kT81KSGU8M16dEo9XUJLb1H7Wp0xi pVGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770028685; x=1770633485; 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=jxwZvnhF3oQwannNLGicFGTT7cRyzihZn9lUXOj4q18=; b=mj3Zmvz4puyQfyB9EBhQOEa4beGNX2RN3BGKazMF8CD1pc5mrqqCb6OJBOCuKbwAZj 1FjtbQ1RmyRZ++0rYfcX9Y1SqJGEg+y7s5fwe38Yz1S46qnjmliPyWH9KOXechpuO/GG OoN0IrF0hT9obQnfqI/2HZvfney/0b+azhJ1b4l6nDeXKVgp+HqpaT59pXaReHJn7iSf GjFXwG6MfeuheTJRIOV3om17lLU6QTVJriV1iSKQXRLvXJk4G32iR4gDyuhoC1iqKpDu qzcXYVxyz1GdCmOcQO9C1uFzfouHRtUh5PFujn1Uzwm44xsUCwSuq8tFsWY16LQL5338 xoiA== X-Gm-Message-State: AOJu0YzL1M/seBqtTGU8VhliUA82tnB1yvW2PfPkvQdPP2QaVNVSuDGS nYyVfCX1OsqlVHdV1ZN0DFPHaCgLW21PdgVSSPJB36MWIhtEEWmV02UWzsyCG3sa6pGjQPGIrrf dahBw X-Gm-Gg: AZuq6aIlALjILFs9h8fvNjUpteIa3iWwFJA4i6dcjJoU817NMsTOWeiT0imwRT8y6zM MaNfRrXVeLwLkGRKVQ6q5jGMrB2srozcB7yW6oSm/DvVdJw4E6JygvNWFM2B8nGKt/GU4tmIYu3 n1eOauVB/5pr+hRBPgq3yuAfEYDWxSFXmeNt6cbsYEPk9dRJ1Q8DywFEXt0MhuhOydSQZEItjhT X+aBs4bpgN8GmSAWVoV+M/6BXf6TkTVZvQH5imNSd2/ERKhlkRJpvVzLSe0lQIiXThOkGsoHsXT YO0AIJlo3q1+FcQBQJnCvhgKb4ZsfNKz+r5TzrsE74MByEPgO3Ec1EdL/AWMkbYw7uw/6Yc4Vhd pOOPt0pXh2fJ76SVJKad/CLHIHKrxoxSpadqdgJxe4ruRdT5vkQrYDuLnyBOy59Vg6xQxa85kwj EFdR3kk+wg8x0eJg== X-Received: by 2002:a05:6000:1a8f:b0:435:ad52:31d9 with SMTP id ffacd0b85a97d-435f3a824d2mr15416371f8f.28.1770028685377; Mon, 02 Feb 2026 02:38:05 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1354d43sm47020132f8f.43.2026.02.02.02.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 02:38:05 -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 v4 0/2] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Date: Mon, 2 Feb 2026 11:37:54 +0100 Message-ID: <20260202103756.62138-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 v4: - rebased on drm-xe 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