From nobody Sun Feb 8 08:48:43 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 F0FCF35CB86 for ; Fri, 9 Jan 2026 15:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767974253; cv=none; b=UqitTm/o7dBxVj5B/3/uqks1y9IBFV1b9a4rMgv9n+pj3jPosmD+fapf7aqQxpLGoyC/PZH1GBYPVvXg+5zo3fZgy+Rtph4OYx7Ly1YF2HIw/ycGtRMjk0ezIW9d9IggU+ssP/coivoCQdzTuFMeKzAycWxNAK5Kjak27aFeQ78= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767974253; c=relaxed/simple; bh=oCrvom2OJzdclxUGpq01byfcG95o1zupBFvuXN+rUI8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OQcdA/LanxohoR87q3gCOogKkDbeGdwXDO5OEeImWwGTsx0jFUHdbrIZf+IRm8ayVQAO5X0UyyLTW01fzGkPeGlGTEHo4PlgkecWMiBRTxL/d1Fx4cYNkOBN1vy4PADaeFrdeoWKHm1i9gDtitRJ8vqKvWsM2jLVFe6QqM2Ny6Q= 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=dMlY4mU1; arc=none smtp.client-ip=209.85.128.50 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="dMlY4mU1" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4779ce2a624so36652315e9.2 for ; Fri, 09 Jan 2026 07:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1767974250; x=1768579050; 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=2ix+9G0m0BaEgIthBMoGEcz3Z84BedH0qPmTYz4OloA=; b=dMlY4mU1y+M+LySychkaWB3RYI0Dp8M1CjW2A01iO32fmuer3RfhbuRWZDJdAAb8sO YzrLsjaLBU7eLubk1vHXZoSCeXIMIJNvWmwSUkGG8lXbfctHAO/HMHty7u4Gkalz95ks i79zEkIIfboA1ywA71OlC4XL/D+ZTnSAJ0pNEPa1VW4WPamfSOTHsi0zXTMub67mnG58 8lhT1mP/wTP1dckVhS3gcWypkW6wRzaWxZhLerFWiBunfzZkEwrPn0/dqhzt4BLy59Mz m5XYVxXdMBAp7mAnf8jxeIyv7yjqNpYwZX39AH4Zo946iF0XjUtFg8mGgKi8a6J3ocFi TmOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767974250; x=1768579050; 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=2ix+9G0m0BaEgIthBMoGEcz3Z84BedH0qPmTYz4OloA=; b=MEJ9LxrkKUaIHS0AxaHSZWLnZuQ1buCfxdvqzeIRgSp9FZwWWvkxfxscs/CgFh3Y3m zNn8bmpa0rYBwI21rsSmrBsgXJvCdsvWP0y1dZgoqAqNr81GG0pRlfmf4Ifai75ZWaVM 3RNB1k/6I/F0gEDR8pS9CLNPPlk9AKvlMXULHPnnymrsuadcGGmBb4vxbOsjyDv8byFe 2nCtd8w3Cd763YqNKbprpbhm0gprI3aWT1M4bOQO5scbWEIZey5orBb6MIRSjIVbt5dg ydwxHIlwxHYci4rZ1AVUNRkiVkN9aL3dL6X50kEpDlwEyGMdgSpehrkjLUcTec1uBckv 8tyg== X-Gm-Message-State: AOJu0YyeB29WtQgqoykdvpl6oGGkrTuzxmZr5n3IxT8qjLGe8jHwEH7R RW81tjysgDQd13I/fkXg2qhF4nf/RChircmHJH6BXq1O8Xly/00I+uFnbwtJqO2RrVLEXeJpZPV kb/lV X-Gm-Gg: AY/fxX4A6nhBw2MWvElxKbMDGEzPyGrvyWfXTTi74GhvRZUMCbpiHHzZZq9ciZxakKu onKeloM8FvIaOD8KQwr+0N+LeU76Kk6d7zvdROUx2Ul/SpDw0I5wBOUD3eHgcmUlxSxxcljlATf YZ58bfzP8ZkV4ZI2s/PTnC3E6zySpDfCO6DpAD5LUfJIKNGfjp4NsORZmA9lZhe8dYr70H1YFao XJXyBmv6WU5ji+mZwyR1q8J1p+Y9tbKHp+sv9ier1hoH99/Q8SL/zUOwIm1b58iY8CHeVtuJ32w kvTIuZs3A8WRX2HfGXOQWC3wd2jPxr96KZ03wLKhGFXbgFVxPgbs/tKKG6Gw9hHl9UQxeoo/DnB J1nVNoA5DOZxlV0EPIGzz1JdTP4sM5XA6lghRddeqNelI215oYMteJepnIdwcu841XRsGOn5o3N LH23bfrE7L24deRw== X-Google-Smtp-Source: AGHT+IEjcgfZoQVHawjXdqV+0cp6ZHCBWOVI5xiLde3MW66VrT17DHgkEYqNw8U2z8x2ia/O7TtWMQ== X-Received: by 2002:a05:600d:103:b0:47d:403e:9cd5 with SMTP id 5b1f17b1804b1-47d84b1fce2mr89769945e9.11.1767974250006; Fri, 09 Jan 2026 07:57:30 -0800 (PST) Received: from linux ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f390a69sm214567355e9.0.2026.01.09.07.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jan 2026 07:57:29 -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 v2] drm/xe: Replace use of system_wq with tlb_inval->fence_signal_wq Date: Fri, 9 Jan 2026 16:57:17 +0100 Message-ID: <20260109155717.269221-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 'fence_signal_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->fence_signal_wq. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- 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..2e98f407c59d 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->fence_signal_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->fence_signal_wq =3D gt->ordered_wq; + if (IS_ERR(tlb_inval->fence_signal_wq)) + return PTR_ERR(tlb_inval->fence_signal_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->fence_signal_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->fence_signal_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..1a3e239ea3a7 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; + /** @fence_signal_wq: schedule fence signaling path jobs */ + struct workqueue_struct *fence_signal_wq; }; =20 /** --=20 2.52.0