From nobody Sun Feb 8 05:37:02 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 71A6B34A775 for ; Mon, 12 Jan 2026 09:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768211059; cv=none; b=WZ3OgUsfgQgP81yF8akUkf90OMARsfgrHZZNFsYods29ylyT44gKUKVGjKZVfVrcXH6wo7PXV8/lVIdC9klqEp8O+5dok118GhHFl1Z/s5enItGmwRvp3hTjcL6E1hB8I4zhCAwh64RT4vpTthrgM6Z4e77qDGQBMqTlKxkAvXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768211059; c=relaxed/simple; bh=mvdinrvcHYl1C/JYWjPLqaxO0f8sceu/EucQQH98M20=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N0/f58omrlhs7fkpQUudETiQcmU9EVMkDGC0l57tu70AvoLMOEzqU9rjcQqR+Vl6i281UGQlPEJJU9VyIqONiMAAx4HopRj30lmTMPtyPSwxqvM9UO0HfsOkUSm8rc2+eaCsvOi6P3lKnBZV8RaOrzXZUGXNKHjBL0Znmtd1fYw= 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=BAmMBLDv; arc=none smtp.client-ip=209.85.128.47 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="BAmMBLDv" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4775e891b5eso28045925e9.2 for ; Mon, 12 Jan 2026 01:44:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1768211055; x=1768815855; 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=Nw6JgxEvUK1B1sbKyu1+Uffm1p7eWghGzg3C2Jww0Ws=; b=BAmMBLDvORKJUiJqegLYSxH2Eny/vrVs7hi1J0GRtC9ibcY/InN2KKth2ioo7lRGjB ymRELF5JkcvucEYluOXkqXy/PXr6XPl0gGcX66NamlmkP6xtgU0qhH8HkzX9YeeDl5Gu X9V/IU0vh38crFfMgtyQWzAmFzCzTgHbmuUVBeXgbaSW7qseKnCdEV5tJpXVZ3w/VY1X e8gwnp3fNCYPdhOW8RSRqCS84AkWIaAAUFKGI/v2veiljFUWO573MVN/6kcvMU/sX2Vr FlV5YwrJt2Z49MdWcoeXshF3SyprQ3Mv4ZHlxe9gv8qMYfR8iAecAfq4cfDMWT0u2nbA VS+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768211055; x=1768815855; 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=Nw6JgxEvUK1B1sbKyu1+Uffm1p7eWghGzg3C2Jww0Ws=; b=XRnPgQ/hTZT+MaRLwBabXX50PN/BfIacVZEmaNu2sFVpbWUGGKCK/HELweCm/CowRq 0447qQYfuGRhKoQ1cioIxQAsCOeU1apoICgFzCHFZDpOrNr2je9OKDQpaVkiNssTzI16 hG+nYQgTn83DenuUrCCP8DAFJYCDeIK088f8w+pqXWNO2XTmJh+cCzeGxaweAXg6bsR0 yFv15xz0zMynN5Y7q2FAOLcNj4vWyyInlJs9m3G5nBWbE9y948Xv8Pt5tdTP3OCFNriq W+nS5nwhAPoueSF/oLmukhjK2IpnZbw1Nhq7IeWiCSn7dwZC6kIPnzYsIBzAdvvQpbNp 2z4w== X-Gm-Message-State: AOJu0YwQB3l3HCVEXv4vp75k+ZQKvR2bnRHYCQyp7Myi5KJDizBRF3d+ +3YfSI7fIH90t0TmcVqJe/LjjXmHGFn41MDFG+J4xwlI+0zB7Stmjw5ZOqKhVigFXhLVvvpMsxz GEaIs X-Gm-Gg: AY/fxX7PgiDve6SIXTsVnH4YpFJGcJwPWq2YzczmhnrZNVqjF8mvLnb4brYJaIC2iUF XDrZHwMqm/YqjNF5zIyTgUxdEyqWlwm9DAp6wtJ4n4wMj1CfK2eEs5RWIlXEuHFFZXbE9Vwp3H3 bB1NhE13zF5+CO9y9AJ8RiCC60EXANBRdv3RIhpjcroq7dCrB1rtKih9QKyaupHN6V3sgYYi3OQ IPcze338DsrbybLxomURueQzkaspiWBtDfeHiZhfqe/n4DPwtIO1jP2xu5Ju6t8mOJfVfA1YRP3 I1A3fOVlqIfEVmf4HNXy8Xw6Tfi1po98SDwhJF4H1lfXcqeQGv3mYCYS9Nmio3mFt1Zd2jB8qzl EHL2s7cPPRMEdF2YRly3WF8IZYl3wzIjizJdTWpQPe4dPuAvbQ3XpHDjXIxJuUgcJvLifxiGQ3N hFKs16O5l7x2DWgKRMio6lBf6Mp2shGwhuxP8= X-Google-Smtp-Source: AGHT+IHhiEtlHK1jzbZPbQ/fSMYsaHD3izE9MDeZzbbONDKCc+xdVbegLsillSKVmJA/ym3qIMPwjw== X-Received: by 2002:a05:600c:3493:b0:477:333a:f71f with SMTP id 5b1f17b1804b1-47d84b3471fmr191689965e9.17.1768211055269; Mon, 12 Jan 2026 01:44:15 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d8719d057sm125389655e9.16.2026.01.12.01.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 01:44:14 -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] drm/xe: Replace use of system_wq with tlb_inval->timeout_wq Date: Mon, 12 Jan 2026 10:44:06 +0100 Message-ID: <20260112094406.82641-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen, workqueue users must be converted to the better named new workqueues with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. After a carefully evaluation, because this is the fence signaling path, we changed the code in order to use one of the Xe's workqueue. So, a new workqueue named 'timeout_wq' has been added to 'struct xe_tlb_inval' and has been initialized with 'gt->ordered_wq' changing the system_wq uses with tlb_inval->timeout_wq. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Reviewed-by: Matthew Brost --- Changes in v3: - refactoring workqueue name from fence_signal_wq to timeout_wq. - rebased on v6.19-rc5. Changes in v2: - added 'fence_signal_wq', initialized with 'gt->ordered_wq' in order to use it in the fence signaling path, instead of system_wq. - rebased on v6.19-rc4. drivers/gpu/drm/xe/xe_tlb_inval.c | 10 +++++++--- drivers/gpu/drm/xe/xe_tlb_inval_types.h | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_tlb_inval.c b/drivers/gpu/drm/xe/xe_tlb_= inval.c index 918a59e686ea..084d996b818d 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval.c +++ b/drivers/gpu/drm/xe/xe_tlb_inval.c @@ -94,7 +94,7 @@ static void xe_tlb_inval_fence_timeout(struct work_struct= *work) xe_tlb_inval_fence_signal(fence); } if (!list_empty(&tlb_inval->pending_fences)) - queue_delayed_work(system_wq, &tlb_inval->fence_tdr, + queue_delayed_work(tlb_inval->timeout_wq, &tlb_inval->fence_tdr, timeout_delay); spin_unlock_irq(&tlb_inval->pending_lock); } @@ -146,6 +146,10 @@ int xe_gt_tlb_inval_init_early(struct xe_gt *gt) if (IS_ERR(tlb_inval->job_wq)) return PTR_ERR(tlb_inval->job_wq); =20 + tlb_inval->timeout_wq =3D gt->ordered_wq; + if (IS_ERR(tlb_inval->timeout_wq)) + return PTR_ERR(tlb_inval->timeout_wq); + /* XXX: Blindly setting up backend to GuC */ xe_guc_tlb_inval_init_early(>->uc.guc, tlb_inval); =20 @@ -226,7 +230,7 @@ static void xe_tlb_inval_fence_prep(struct xe_tlb_inval= _fence *fence) list_add_tail(&fence->link, &tlb_inval->pending_fences); =20 if (list_is_singular(&tlb_inval->pending_fences)) - queue_delayed_work(system_wq, &tlb_inval->fence_tdr, + queue_delayed_work(tlb_inval->timeout_wq, &tlb_inval->fence_tdr, tlb_inval->ops->timeout_delay(tlb_inval)); spin_unlock_irq(&tlb_inval->pending_lock); =20 @@ -378,7 +382,7 @@ void xe_tlb_inval_done_handler(struct xe_tlb_inval *tlb= _inval, int seqno) } =20 if (!list_empty(&tlb_inval->pending_fences)) - mod_delayed_work(system_wq, + mod_delayed_work(tlb_inval->timeout_wq, &tlb_inval->fence_tdr, tlb_inval->ops->timeout_delay(tlb_inval)); else diff --git a/drivers/gpu/drm/xe/xe_tlb_inval_types.h b/drivers/gpu/drm/xe/x= e_tlb_inval_types.h index 8f8b060e9005..e5ff35226826 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval_types.h +++ b/drivers/gpu/drm/xe/xe_tlb_inval_types.h @@ -106,6 +106,8 @@ struct xe_tlb_inval { struct workqueue_struct *job_wq; /** @tlb_inval.lock: protects TLB invalidation fences */ spinlock_t lock; + /** @timeout_wq: schedules TLB invalidation fence timeouts */ + struct workqueue_struct *timeout_wq; }; =20 /** --=20 2.52.0