From nobody Sun Feb 8 00:26:57 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 8C94230C63E for ; Fri, 24 Oct 2025 09:52:19 +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=1761299541; cv=none; b=nvzrv2fG1qFq2OpzA0yRZTQUQ7u8wF1BDWpwuCKgyUTdfnmf1Twz35bQ/bCE/2JjuGJ6DU4pmL0vrkMQT7V5fkCLqD4Kjj6bGSonmmN0IdjvzuBxGj1ct5NwtM1ANULcnr7BoiD5XROc0gZCdPvhikjoCfj6FNRKMJTxRdaORkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761299541; c=relaxed/simple; bh=HPUYsFiqxKAXZMUXJGm2P4ah1g8qjFd+qqL3B85O7Z8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U5kw+QWCPmmjd29HhhTk5ca1JmQaINKIPrji9SyOfCu8ZdNFEP/Sr9BW9cT0VQydO7lteucIxYe3VctVL0ZavFnzDzqltF45PqkAY3UjlPDYe5xfrawthbxH81EcmJ+H5ieJ8SAJ4L2jVO6pyJAXj5sG6pbP4sA9WB53+BSPce4= 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=ZwaYodZl; 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="ZwaYodZl" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-471bde1e8f8so9634655e9.0 for ; Fri, 24 Oct 2025 02:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1761299537; x=1761904337; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VB2JNLaaiAn3pH3zpI/FXAb8vE+Bng5cZSPLjc8q0bE=; b=ZwaYodZlOorf6gOSEI27pzqXNQIALYCz6OTqqnO4P0azZ/iU//fe2ZCZC/3yDrVJzF NscSrjlvSkesNBfVe3XYaxCpFFAavqgBWKZyxAY36eQaJNXxDsgzFjYIe3JWQHbG4/i4 2o9lSt5TUUmUDbYlIYEYyKhPH8j1SbrCabvp5eEGr2NMm8iUYKz5AvusypANFNXM0lNq go3JduaW4lrKYGjv6KMKaUeHADKOIDEe0BuWC4eGVmhtgKSVNZY8HqZU76dEy52tN/7r w6sZW7DxirxjQ0XB6jdovE84mVEp5y264H2R7WFh6F2wCRNYciL9t/DNconofEUXRY1o VztQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761299537; x=1761904337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VB2JNLaaiAn3pH3zpI/FXAb8vE+Bng5cZSPLjc8q0bE=; b=maMB1lAVhc3gLDsmnFFcNQejLd9MOW6xuCEtL3xobo10sLMxbY05UD8F7J0uEZ/56n +bFwK98kgSGWoia5VDDGsUBq0c/WH6TcxpoOKkuOwm0OXjli4iilcn9cncHZyWqPSBGD 1bJqu2mcRFGjgxn8iYu4zZjCO0JZlqqvd9tK6KpTBYZ2j3XRKAClrtV7DfOkUu3OYVUM I6QBT+E8Byh2Yx6CqAzFQPyclO/N6A2z5Z/asP0HwG+/GTpps7lAvAPpGBufGUqDu+zw Wcu1GrfkCBwrEJrAn5Va1+UjZv+6dbqCcYtlLPRk/DrzyNNCwqiJJi9dcP4K6HxS6IG0 j7eQ== X-Gm-Message-State: AOJu0YzyHfxOeTGNLhLq78R0taHTgVYHtFjFJ2IEi9iUWIKo8yHKJxJ1 XwMOFwZGGaOmPs0qnvogm+da9tWSW2b2/hvANio/GwXz6TKN5WJfAhcSKxFGSVd1835SzuBVAFW iHZfU X-Gm-Gg: ASbGncsp8Hyb3S+T0JUDx8hA1vFQej1PpgaDvIEoRCQ8c1eXkdTjg0RImylOTSJShMM 72BYBBZmy1S367JecyOMvGkKqe25A83X4ZyW7xOBC7pKLBM8XiH9MAin6OvKakkUhiOepj8DRcn VSpA6PEgTxte6zlpwkHKrjcbr2gS/oTYbAADEg1OsB3GqTp/xyLeJiOktCisSk4AR9iDFfz15zA sOwVOFZnpBR1h75Jpw1R18t77GgOP4vX67w6jpNl2/y5HN55td0mPv75A1ia/dKLhp6H8jYumE+ /hbIJlep9XYzNh+rJruawTWRXmp4c/txAyPpoOg6rOgJKCmShb/BtuJXUc/RPfzbOfZGF7I0tIy hZFksg5TkAEv72Lk5CtsQ5PYoLMVvkpyY+B8iixxlSHWC6p3mpUgLX7fLE1sjU65F3V6NoF/ikx m33S57Rx28k6lMHkX0aRi3XYz0 X-Google-Smtp-Source: AGHT+IG9UrAVJY9k+lxCOX2VOATViY8kr0GIMVcZrOkxf6lTmiRwzoVcbu2hrw9RPBg1Zg3p5iG0BA== X-Received: by 2002:a05:600c:4448:b0:45d:e28c:875a with SMTP id 5b1f17b1804b1-47117912b0dmr203107995e9.31.1761299537249; Fri, 24 Oct 2025 02:52:17 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429897f57b7sm8402376f8f.16.2025.10.24.02.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Oct 2025 02:52:17 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Maciej Falkowski , Karol Wachowski , Oded Gabbay Subject: [PATCH 1/2] accel/ivpu: replace use of system_unbound_wq with system_dfl_wq Date: Fri, 24 Oct 2025 11:52:04 +0200 Message-ID: <20251024095205.123123-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251024095205.123123-1-marco.crivellari@suse.com> References: <20251024095205.123123-1-marco.crivellari@suse.com> 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" 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 consistentcy cannot be addressed without refactoring the API. system_unbound_wq should be the default workqueue so as not to enforce locality constraints for random work whenever it's not required. Adding system_dfl_wq to encourage its use when unbound work should be used. The old system_unbound_wq will be kept for a few release cycles. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/accel/ivpu/ivpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index 475ddc94f1cf..ffa2ba7cafe2 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -186,7 +186,7 @@ void ivpu_pm_trigger_recovery(struct ivpu_device *vdev,= const char *reason) if (atomic_cmpxchg(&vdev->pm->reset_pending, 0, 1) =3D=3D 0) { ivpu_hw_diagnose_failure(vdev); ivpu_hw_irq_disable(vdev); /* Disable IRQ early to protect from IRQ stor= m */ - queue_work(system_unbound_wq, &vdev->pm->recovery_work); + queue_work(system_dfl_wq, &vdev->pm->recovery_work); } } =20 --=20 2.51.0 From nobody Sun Feb 8 00:26:57 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 2E96430CD80 for ; Fri, 24 Oct 2025 09:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761299542; cv=none; b=XFQrUUXz+xgKbUkdjcArm/+0lNitfvX/dTg+Xhhvfjh4sLph+QN3eCIOiiM1SkdVgA+n4eH+Ny4UhQWGWQCUKFfhFfYkGRFN0IDgz1dXF3BhmTtcnr7sslm8LsbdD/jKgTx2s9NUb2xHWfxx4dXSvL06wqNsjB9nxItiSBgRwRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761299542; c=relaxed/simple; bh=ep901+m/r4rHXs7yIDCYpyHGBdSsovQkMkllnz1rrDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E3Zi/d1p8d3ci5zyhZqIxU53bIQin4CBanCbknkllTkoMRfqkNncXOkwCVTJxFyaLD6Nf4cAtN5ioU/3+BQrNZjsMc3YcDKvycSFppK6hFPkjh4/TK7W2tZnwFi3xkQXcrIP6gCxFLUlFFJKwg/DKStFh51lok2x7lnoIBwULy0= 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=PRTZNBDo; arc=none smtp.client-ip=209.85.221.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="PRTZNBDo" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-4298a028de6so1153401f8f.0 for ; Fri, 24 Oct 2025 02:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1761299538; x=1761904338; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dL6t4wl66/AcShNCdZ7n7LoevEBAIZyasNbsi4B8v3s=; b=PRTZNBDoX39nsdf7LbO+ZIXe7BIDbTYRsJvjNTtK2vNIUH7CdjzopFhUsZ+k9K3bGx kG3hnOFDODfBtxnczjeGf7M1DwdH9PcexEKuJ5QlzfmJDM6gkiONHEViQQ+hUsQBNHzA Lm1LIMLpvZcukexdlLCKpZ+z3c6PrWguoMWNrawKBuXhIY7f9RYZfzhR5bTEfmsFTDw8 JRAOg2RFpoeLLBlZavyLBSEVDYX+BegdV+p41GIxPs0PPpsFQbcggVtxLohRIHxAKY9Q jAP8Y4Chc1F/CPo7zJs0N5XrpPgxfKlW7QGrTeKyb1gkFVWVmU1eArdMCdYA2ladyOlp QaGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761299538; x=1761904338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dL6t4wl66/AcShNCdZ7n7LoevEBAIZyasNbsi4B8v3s=; b=R6LjCl4kQ0+BW3xoPm1i1TbvDyNJANCtkZJ9cMQVDT52HeHtfgqK4issc4gX0VMqg1 4vjy8vgO6oOET4o1qN1rds4MEo4UA+vrn3/Ls+sXQQagOQyOqkdC9BsEWozBDCQpJ2hQ xLmuqlDdxeFHWpXeTtpJerA96HscrSYdM6rt9fz0C2IIyfhLra1cLWPmLwZ/Qdt+WTC3 0MxhrFK93YV80BlRjWROHoCiYhEdfthBD27WqCVL4Jey0XFOBsmO4a8htXsWcuDn05Sm IQ/CDfc/CRuh4XiYIH35yTsOAsVh5rYQg1aEO8IQTBhr+Xk5l77Qnoiponp9qAFFiyFo g/2Q== X-Gm-Message-State: AOJu0YwR1cPCbeGwunvhCQNPe55VVbqEgflr7l92HOe0Ei/qTfxq9Wq8 OOPLQ1iRH9/YHZefCUt/Tb90d36ZEHU2NGclALEysaPPWgkPhBDHiYBx5KWLnKbLucmjTq44FA+ w10+f X-Gm-Gg: ASbGncv3ptIEGGwbK4RZKYfpnbpSLPjnKARDxE8vzGfCGnVtQ7QdUUSuWrxI8vPU3p9 hliqRqC7xX3fcbX+kKL55IrBUiqTIiAzd+NYStOM9mXiY1PpaQaxJotqzMaWpAs3cgcOYctQDLC QUrT9dDI9kC5DcTaF/z3o2T9ScQtrI7kY3XCmhvpAip0bsrM4xSvcAE/N0hXCqHalmyldicSgbt RLaFTpY7brx9d0AbRYRzxPtJ2EjYdH6sXZ7UT9OqswLM/J1T20XROnSFUlNevNX3QFupOmD3FZJ yuzLBErvYPh0ettDAD6A8d/0YOpv8re8mXiUQe+a6qjp2guomJwe377FVxZ5SrxUcNt/+xantiQ NF0sg+LNA32Dd7nmmgxkMFPnEhHhi74taZklQ5gPpkvzbkwkw00hq/dhvDt1GcmSpPFWLu8llyt epJbcV81Imz2dz9+/xiVfqWkrG X-Google-Smtp-Source: AGHT+IFQ9F5xlltb7vARep/Fm2WMuyxTknf+tJucO4GujtQcq6ALeTqrvlnlEwRyCUiBHpuH8ccDvw== X-Received: by 2002:a05:6000:2dc6:b0:3df:9ba8:21a3 with SMTP id ffacd0b85a97d-4298f563076mr1617789f8f.18.1761299538086; Fri, 24 Oct 2025 02:52:18 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429897f57b7sm8402376f8f.16.2025.10.24.02.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Oct 2025 02:52:17 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Maciej Falkowski , Karol Wachowski , Oded Gabbay Subject: [PATCH 2/2] accel/ivpu: replace use of system_wq with system_percpu_wq Date: Fri, 24 Oct 2025 11:52:05 +0200 Message-ID: <20251024095205.123123-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251024095205.123123-1-marco.crivellari@suse.com> References: <20251024095205.123123-1-marco.crivellari@suse.com> 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" 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 consistentcy cannot be addressed without refactoring the API. system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq. The old wq (system_wq) will be kept for a few release cycles. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Tested-by: Karol Wachowski =C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --- drivers/accel/ivpu/ivpu_hw_btrs.c | 2 +- drivers/accel/ivpu/ivpu_ipc.c | 2 +- drivers/accel/ivpu/ivpu_job.c | 2 +- drivers/accel/ivpu/ivpu_mmu.c | 2 +- drivers/accel/ivpu/ivpu_pm.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.c b/drivers/accel/ivpu/ivpu_hw= _btrs.c index afdb3b2aa72a..27a345f3befe 100644 --- a/drivers/accel/ivpu/ivpu_hw_btrs.c +++ b/drivers/accel/ivpu/ivpu_hw_btrs.c @@ -673,7 +673,7 @@ bool ivpu_hw_btrs_irq_handler_lnl(struct ivpu_device *v= dev, int irq) =20 if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, SURV_ERR, status)) { ivpu_dbg(vdev, IRQ, "Survivability IRQ\n"); - queue_work(system_wq, &vdev->irq_dct_work); + queue_work(system_percpu_wq, &vdev->irq_dct_work); } =20 if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, FREQ_CHANGE, status)) { diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c index 5f00809d448a..1f13bf95b2b3 100644 --- a/drivers/accel/ivpu/ivpu_ipc.c +++ b/drivers/accel/ivpu/ivpu_ipc.c @@ -459,7 +459,7 @@ void ivpu_ipc_irq_handler(struct ivpu_device *vdev) } } =20 - queue_work(system_wq, &vdev->irq_ipc_work); + queue_work(system_percpu_wq, &vdev->irq_ipc_work); } =20 void ivpu_ipc_irq_work_fn(struct work_struct *work) diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 060f1fc031d3..7a1f78b84b09 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -574,7 +574,7 @@ static int ivpu_job_signal_and_destroy(struct ivpu_devi= ce *vdev, u32 job_id, u32 * status and ensure both are handled in the same way */ job->file_priv->has_mmu_faults =3D true; - queue_work(system_wq, &vdev->context_abort_work); + queue_work(system_percpu_wq, &vdev->context_abort_work); return 0; } =20 diff --git a/drivers/accel/ivpu/ivpu_mmu.c b/drivers/accel/ivpu/ivpu_mmu.c index 5ea010568faa..e1baf6b64935 100644 --- a/drivers/accel/ivpu/ivpu_mmu.c +++ b/drivers/accel/ivpu/ivpu_mmu.c @@ -970,7 +970,7 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev) } } =20 - queue_work(system_wq, &vdev->context_abort_work); + queue_work(system_percpu_wq, &vdev->context_abort_work); } =20 void ivpu_mmu_evtq_dump(struct ivpu_device *vdev) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index ffa2ba7cafe2..0cff8f808429 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -226,7 +226,7 @@ void ivpu_start_job_timeout_detection(struct ivpu_devic= e *vdev) unsigned long timeout_ms =3D ivpu_tdr_timeout_ms ? ivpu_tdr_timeout_ms : = vdev->timeout.tdr; =20 /* No-op if already queued */ - queue_delayed_work(system_wq, &vdev->pm->job_timeout_work, msecs_to_jiffi= es(timeout_ms)); + queue_delayed_work(system_percpu_wq, &vdev->pm->job_timeout_work, msecs_t= o_jiffies(timeout_ms)); } =20 void ivpu_stop_job_timeout_detection(struct ivpu_device *vdev) --=20 2.51.0