From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8862C3988FA for ; Wed, 5 Aug 2026 14:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785941611; cv=none; b=CWPyM2Zawiwo3WX1Bnp3P2r7Az3IFuwMSUebKMn7d7ry67nq/1DxNJ1B0aZCj5pkiXAnzSK2H4yvsCrDwI4ohVF342ivyddKnKXeFscTShy1azV87rOIOCdmtX4fyCbph8lg2WpjznEfPS9EoJ2u4aBUp3YYdpD+aRyMSVllBvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785941611; c=relaxed/simple; bh=+sKjORVDoYgAz6KAcrvpaFL8T/8exmvvz37tCKlIasA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=da1TpJ7noVkd7O2k+eZLbalc4C37uVOktmnukFOton6tOdD9tQn2P7pRNYMiqWEabadEt6sSKnnm8IMr0GSrg23HEDpBP2PW7mT1DkgQz2ouGqHkCAFah/0jPfDeCS+RIcQwTS7NEbugZYUvuBJiul4NLwSqnXN0H46rU0PAIZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=PlX//H5j; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="PlX//H5j" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=BDEllrOPZwi7tD4pCorU9CsCABLFO/jicUEESODJH5o=; b=PlX//H5jAWf2mIYuTrUyMim9Hc MBxI2+WdJBf23onpOMtQtIZ4uT+MyGgzGi/z5iwWu9kdVS8ugqmuRqlEeVWBT8wTSq8jB9VRLi+WE jbMxDqYPkFdaSG53R3qWnuiIuNKcmqLIDJW54ErLJpaAS0jT5NEdQCPLsGDGDhFLJ0zldJXGzSHaf NvgcouBlyGzcz3PP4yS1c5GxF4uF7/+s5LgonOS6zHrb0VY9HQQw6XqI8AfltecnZW+Fb/uvLO9mS GYWzmILCQzYhykrfhha01K/VacDkXdkpDUWO2sEfUnjyvB/pdktWwxsw0RAPwVn/ik0hWkIV9KXd7 aqYNhbLQ==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wrczl-00DzgS-1Q; Wed, 05 Aug 2026 14:53:25 +0000 From: Breno Leitao Date: Wed, 05 Aug 2026 07:52:34 -0700 Subject: [PATCH v2 7/9] workqueue: allocate attrs for all workqueues 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: 7bit Message-Id: <20260805-wq-pool-refactor-v2-7-fd498d01d695@debian.org> References: <20260805-wq-pool-refactor-v2-0-fd498d01d695@debian.org> In-Reply-To: <20260805-wq-pool-refactor-v2-0-fd498d01d695@debian.org> To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, marco.crivellari@suse.com, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-f8e9d X-Developer-Signature: v=1; a=openpgp-sha256; l=1642; i=leitao@debian.org; h=from:subject:message-id; bh=+sKjORVDoYgAz6KAcrvpaFL8T/8exmvvz37tCKlIasA=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqc05KRfZ/7RkVz4ABZ3XPAUTemPCtN9eq6jEop AFtMD2AyVOJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanNOSgAKCRA1o5Of/Hh3 bUpyEACQ8QrSksPDbGaZWQu0GZ0hAm6EyIzsKrFOHnnpz8ytHcBMbdJ56ZzHkyLhPWdTcnrSXOc BhgR1zg8os+J47EB3bHGNvHFWQgkaZTqOonVpm8BbIY2me/rcU6LcGapFyxHCIdPYPy28ooRaUu cBS3hI8add+ZZTY59Rq+4K35n+hgftExbKwf7dlUd0OSC5u28dJB7qmq9i5Wahe3ni67Kmubriv Kc0XfuluzyDcp9m7AeiS9ct1q397DExdP7flsOaxDkFvSP6OZs2OViBxp4YpXDEubEXns4dR9Rp tWs1QILAOcEPd2J5gEibkud5AEJOLxHkpzojaXY9PAjAhITlGlTFbMngsi0z/n9E4mGLayI0l6l 6aPE2DGgZYGKmssju4/xPA7PKzIGDQtymoAOuysEa9iDOD+tgkQvtmc9hgDTAwVCAUA9NlrX5FW pZanGG/CAG49vh/jg33DA59Rj3pY0c3gVTkwhCey09k9Uh3AFLinTMm/POinIl2BoWAWyPNjqSw cDlTbVcks8qW1ICpcqoP78xc7cpvVkFyqcJpzMSNhSZVqUHr6QrCtt1P6VcKzG/bnMIxHeE/STT RiqtB+RaPZObChDi2Zmgsm+oCA/kqyiL+vG93m4YhLIB+KnY0VMqRGkpoKb6icI8z40OzHVRery HgDoEhP3fPwk37g== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The attrs are where the affinity scope lives, and a per-cpu workqueue will need one once per-cpu becomes a scope rather than a separate backend. Allocate them unconditionally. wq_dump.py used a non-NULL wq->attrs as its test for an unbound workqueue, which no longer holds; test WQ_UNBOUND there instead. Signed-off-by: Breno Leitao --- kernel/workqueue.c | 8 +++----- tools/workqueue/wq_dump.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index fbe13c9be4c28..e13f223e8502d 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5902,11 +5902,9 @@ static struct workqueue_struct *__alloc_workqueue(const char *fmt, if (!wq) return NULL; - if (flags & WQ_UNBOUND) { - wq->attrs = alloc_workqueue_attrs_noprof(); - if (!wq->attrs) - goto err_free_wq; - } + wq->attrs = alloc_workqueue_attrs_noprof(); + if (!wq->attrs) + goto err_free_wq; name_len = vsnprintf(wq->name, sizeof(wq->name), fmt, args); diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index e0a6936a2a37f..31afc24ef17bf 100644 --- a/tools/workqueue/wq_dump.py +++ b/tools/workqueue/wq_dump.py @@ -205,7 +205,7 @@ for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_( continue print(f'{wq.name.string_().decode():{WQ_NAME_LEN}}', end='') - if wq.attrs.value_() != 0: + if wq.flags & WQ_UNBOUND: print(f' {cpumask_str(wq.attrs.cpumask):{ucpus_len}}', end='') else: print(f' {"":{ucpus_len}}', end='') -- 2.53.0-Meta