From nobody Mon Feb 9 04:14:27 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 CF432265CDD for ; Sat, 1 Nov 2025 16:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762014709; cv=none; b=F14FtfinKmtBIRvQJGamErVY63vfFkIiLGi2fVyYY84tP7xmhcfTPo8s6t3LQ5zvvUYreP+zj5pN1/+zb9Q4m9ZZeWAWPF3RRAXYXq5Z8Y1KbuSdswAchvrkAGVX0KsmyR0LwaKS+EBoBos02nrQcrLv3cul9hGdBTbxJs26RvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762014709; c=relaxed/simple; bh=M+HTbFEvOs14zz+Qzo5NFOodIQwx4sRzNfxNyQ6Vu6E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IrkJkEFZIqRRTGDaee8sNq/5Iy18ETahvTFTxwtqtsyC8s79jrfH63Jn5ICjx7/yWAHFa4Q+isd9Y4lUZCfY4R5vi6ssWrCsZ46wkZgFbXM1HM1vYPkZqpAG2qPt5iIZ05mF0K8z+YOvOBn+O0nWs/xlX/3t9YX7/dwcrBa8v18= 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=U9McLapY; arc=none smtp.client-ip=209.85.128.51 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="U9McLapY" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-47114a40161so36378795e9.3 for ; Sat, 01 Nov 2025 09:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762014705; x=1762619505; 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=edy/Vm6M6bIk0NgCarBHEsL69x+coUeeUJHets+qLoU=; b=U9McLapYF6WPJdVbrtLTblECtVj0lZPUbW1YZfqfLDptVZVHVqn8p87n+3UooO+wrN ZJKuXbXhE6xpXi9QvSFM1miED9h4b8gzO0QtJ4KMIrqFP7weVpxUMtTHSCd8Nu/vvFuA JuHRmvwIm6wHrSmmOnV9L2MaAhF2tEcM8gCnKWoLy7r2MdiZD61M4zjDKTjytLg105/Q BGHU7S4ci+S+5wndMZQukod/uIqq8Mm6dy880LixLbToT+O3V1WLpyjbXKZT8ALHPVcZ Yj4PKJdWaRXyeIQ3qI2GoG8IXGCsReOPBAq47+LdHJfL8GylEhHfY+ffcrU+4dR8xQyq sz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762014705; x=1762619505; 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=edy/Vm6M6bIk0NgCarBHEsL69x+coUeeUJHets+qLoU=; b=Y77tOhWBKSRWKjGlZe6jqtI4BBKyqB0yh6bQBvR69iFs8Sjo0jzFK0eXEYe28vDKXc U1/jDaSLiyA2GcaYCXfLuwBISVz4cFbS0v0rPJoMCuxL6ktGG5iWvMKUpQXyX2krCMW8 9pUoDVIDp2PaH8BTdMGrG42Uf5wZeD4PMdYVs+xNK6bjRom/+TFmK0ML91ZVWCUvvzt3 0y1LnXr27ez/Fr0oGG4OGb3sK6GiM2Sm7iFIbN45pUXPlQA1mtAA3uDZGEguUPlQ9tWS EwLcuWkLbka9OqzanKC9GyAnEoffSobBB3+6Y5hFpvWVL3EfJkoHSNLiFlOe1I7yPvfz jnhg== X-Gm-Message-State: AOJu0Yx21m+ykM9WnFB2wrt2rWZ6Te3ZOX5E8vzKzkH+DCg1PRb4+hfz 3EI1xwAH7CmesaZ8Xb/SK/1yeHpRCdr23Orq95y7u7Z9bVjviN48aJazmSajS8X46idBYB+tmMk du7aP X-Gm-Gg: ASbGncsCtgf17UdSj+e8MIaX3QuAcBfaBn4Y45Ab781QJJT8m2pzApxbTIzsKvLO768 lvRpHzd9VoV8n04Zhoe5n0Pe7GbMgRcrjYgajIivNlRmnMNrGAPzOQOSfxBq3IzQywL87TVLYZF oyulg6Zwage0dn9XWulYvEBQctcsCWNIvel9G1ArSne5CXliy+8r3u3sL/hMtWdtuiL9MH7RrF8 jq97909/iR1l6Ozth0Dd+zLZVmdkderjHCakgOU2p3JTti4UB7MChOEmkukOgqCZNfmoPeRKwGO F+QBVYBsy+0l3Fv2P57jKwf7aNQNPUQH6qOCnaRcWbzOewjyg8Kd4m38xjA/2BkDhVC8S6nyibJ 982FhbwvHPBXDdCvZWmJ5bFdiODSPNx7G2eDUCx81lXdYo8vaLPZ59z8IOIfAT8Kwp5JQqBxAIF Ajafg8r/iCA3gTyg7yRyHKZhD1wwwT70FYq9w= X-Google-Smtp-Source: AGHT+IFERS3rJ2ULC1YVWKNWA3KseWiAk4MFC4NTTgLowJegNZ8jjdlLfmXtfvReueuEEHynaSc8Sw== X-Received: by 2002:a05:600c:470c:b0:46e:5b74:4858 with SMTP id 5b1f17b1804b1-477307e4890mr65694995e9.13.1762014704826; Sat, 01 Nov 2025 09:31:44 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4773c394e33sm56742285e9.13.2025.11.01.09.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Nov 2025 09:31:44 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Jason Gunthorpe , Leon Romanovsky , Dennis Dalessandro Subject: [PATCH 5/5] IB/rdmavt: WQ_PERCPU added to alloc_workqueue users Date: Sat, 1 Nov 2025 17:31:15 +0100 Message-ID: <20251101163121.78400-6-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251101163121.78400-1-marco.crivellari@suse.com> References: <20251101163121.78400-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. alloc_workqueue() treats all queues as per-CPU by default, while unbound workqueues must opt-in via WQ_UNBOUND. This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they=E2=80=99re needed= and reducing noise when CPUs are isolated. This change adds a new WQ_PERCPU flag to explicitly request alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn=E2=80=99t explicitly specify WQ_UNB= OUND must now use WQ_PERCPU. Once migration is complete, WQ_UNBOUND can be removed and unbound will become the implicit default. CC: Dennis Dalessandro Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/infiniband/sw/rdmavt/cq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdma= vt/cq.c index 0ca2743f1075..e7835ca70e2b 100644 --- a/drivers/infiniband/sw/rdmavt/cq.c +++ b/drivers/infiniband/sw/rdmavt/cq.c @@ -518,7 +518,8 @@ int rvt_poll_cq(struct ib_cq *ibcq, int num_entries, st= ruct ib_wc *entry) */ int rvt_driver_cq_init(void) { - comp_vector_wq =3D alloc_workqueue("%s", WQ_HIGHPRI | WQ_CPU_INTENSIVE, + comp_vector_wq =3D alloc_workqueue("%s", + WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_PERCPU, 0, "rdmavt_cq"); if (!comp_vector_wq) return -ENOMEM; --=20 2.51.0