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 213433A6F04 for ; Wed, 5 Aug 2026 14:53:26 +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=1785941607; cv=none; b=KQRN+BGgsWnyAIno6TFL/UQyofdd93Fuz3IAoMWIVqWW2cT4sb+hAJahNv1BcyHV8vab7LuaKpbBujmkpcUTqCf5sSwbiA5npo0rdHHMXH0vLz2qGpFtnujj4tfWCLyyI/zguRXHbd2ktHmINsXquxCK/TSXZvR8bFY9bQu5Dv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785941607; c=relaxed/simple; bh=/Tk4GsnNCc+8xkF7b+iwB0KqaYbIYKyFlG3OYOQMPUw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ya9LUvVKLV1nfG3QxqZRcyHstIpehxR9NBlhO/9Z0rdg0HeJ8k36uuVPo9J2aMGrrvTRnPX4rP846HQqgT5YbSlxbkYnoR8p7Y549xdIXNJ3qO+LYtc9fsKkH4asotnIE0AdoO4tv/BlXE4QnNa4r+TwNcgyu/M19wA5hkgDXpg= 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=EoS/+09m; 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="EoS/+09m" 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=H4n42a97Bjf/jMVBIPhFScO3Fzdfr5SY0KRt8vBBajY=; b=EoS/+09mT6r/So7Psvh2vk+QcJ nb6qIR0RaVYzcgtzm3i3KIRtgJJs36cssA+NGS3rDAPb5YgK4b3Klj6pFCbDD/1tUpqQvr7aDI0+H XW/lHlZYFmkq1o5JGxp6nEfTUMAFSBko9K1BipLOVp2sfEVD8K8+wFKpeHahEkqtNIatfgR3mlu6u U52IYjI7fp5bJH+2/qEsNI/iIkoeqiHUdA5srt7Doyh5Z86KTcvqjYjauuNORah/yZ1jQZVReLc1p 33X7qDooN83NT8mtTewWzyuxuWX20mj3q/KhS72N08psKIOlgKkI8xGwiHJVNLb1uS6jcLcegFcq2 BFUOXonw==; 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 1wrczi-00DzgM-0C; Wed, 05 Aug 2026 14:53:22 +0000 From: Breno Leitao Date: Wed, 05 Aug 2026 07:52:33 -0700 Subject: [PATCH v2 6/9] workqueue: rename wq->unbound_attrs to wq->attrs 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-6-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=7918; i=leitao@debian.org; h=from:subject:message-id; bh=/Tk4GsnNCc+8xkF7b+iwB0KqaYbIYKyFlG3OYOQMPUw=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqc05KZXh9RYxbXWFiEIdRvhfwDgXHzE4rSV3VV WJdfKW8v7WJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCanNOSgAKCRA1o5Of/Hh3 bfxlD/4/ZWlriaaZA+REw6b3Tf2Iji8Wz320F+GHIhLj+D0KHELhp2XGKqA3VjxrOorG5NPqLGc B7uDy5A+ARhSw3CnK4ollxqaQWSGcwDCNdH4zrwvpNaFEdr2Y+ZpWh+c5Ek+4vF75OFBauB7mef dnxocf2lB2O3SvEjWKIFyZhXxm5JAw4lT2AbdAtRDZn7rZw2JfrX6EucSNDChcpuBANTFgTutIG WzmqFYyQT+TEBPfAk6mhfHMNfcf8S3img+c/eegaQET3xwRqlFTx79WZ+GEJsFdruKTuYE0NaTT 5Y4mi6IPh1ilSd7LB85qSIDLs9evsfEzZtN7qbgq5KFJruxh0j6CPN9M2pxxL72K61xqq7f8O0u MVpFft4FJn+irPk4py56NQLGvldpY00tvPjefp7LL6zle1vthKQPUR7myy1+XqP7ti6wirSoSuy ZIpSZODZ/ae2mJ4lQRdWnSuUxuU45lDNdSt0LyIJp7Wa8gimTYYUvXPS/trjMB3anYVGgIWXSss efQ8TfI+PEcc3BzaOMajHlMecCSGgQBnlvnfmhNheZmCn6lsTbRAQgMn5jgLecnNQ61NOLOwuDH RiIwQCCt6fytrizUdVetDjZmfDzIEPxg1HzDcNBFRI/EMVFx0hBi4A8lJirUrfwPvt0ChEdbKxZ vrDeW1RKv9fAEiA== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The unbound prefix says which workqueues currently have the field rather than what it holds, and the next patch allocates it for every workqueue. Rename it first so that change stays a single line. tools/workqueue/wq_dump.py reads the field by name, so rename it there too. wq_sysfs_unbound_attrs[] keeps its name: it is the set of sysfs files that only unbound workqueues expose. No functional change. Signed-off-by: Breno Leitao --- kernel/workqueue.c | 38 +++++++++++++++++++------------------- tools/workqueue/wq_dump.py | 6 +++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b6458ee53852f..fbe13c9be4c28 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -371,7 +371,7 @@ struct workqueue_struct { int saved_max_active; /* WQ: saved max_active */ int saved_min_active; /* WQ: saved min_active */ - struct workqueue_attrs *unbound_attrs; /* PW: only for unbound wqs */ + struct workqueue_attrs *attrs; /* PW: workqueue attributes */ struct pool_workqueue __rcu *dfl_pwq; /* PW: only for unbound wqs */ #ifdef CONFIG_SYSFS @@ -759,7 +759,7 @@ static struct pool_workqueue *unbound_pwq(struct workqueue_struct *wq, int cpu) * unbound_effective_cpumask - effective cpumask of an unbound workqueue * @wq: workqueue of interest * - * @wq->unbound_attrs->cpumask contains the cpumask requested by the user which + * @wq->attrs->cpumask contains the cpumask requested by the user which * is masked with wq_unbound_cpumask to determine the effective cpumask. The * default pwq is always mapped to the pool with the current effective cpumask. */ @@ -5098,7 +5098,7 @@ static void rcu_free_wq(struct rcu_head *rcu) wq_free_lockdep(wq); free_percpu(wq->cpu_pwq); - free_workqueue_attrs(wq->unbound_attrs); + free_workqueue_attrs(wq->attrs); kfree(wq); } @@ -5548,7 +5548,7 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx) /* all pwqs have been created successfully, let's install'em */ mutex_lock(&ctx->wq->mutex); - copy_workqueue_attrs(ctx->wq->unbound_attrs, ctx->attrs); + copy_workqueue_attrs(ctx->wq->attrs, ctx->attrs); /* save the previous pwqs and install the new ones */ for_each_possible_cpu(cpu) @@ -5635,7 +5635,7 @@ static void unbound_wq_update_pwq(struct workqueue_struct *wq, int cpu) lockdep_assert_held(&wq_pool_mutex); - if (!(wq->flags & WQ_UNBOUND) || wq->unbound_attrs->ordered) + if (!(wq->flags & WQ_UNBOUND) || wq->attrs->ordered) return; /* @@ -5645,7 +5645,7 @@ static void unbound_wq_update_pwq(struct workqueue_struct *wq, int cpu) */ target_attrs = unbound_wq_update_pwq_attrs_buf; - copy_workqueue_attrs(target_attrs, wq->unbound_attrs); + copy_workqueue_attrs(target_attrs, wq->attrs); wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask); /* nothing to do if the target cpumask matches the current pwq */ @@ -5903,8 +5903,8 @@ static struct workqueue_struct *__alloc_workqueue(const char *fmt, return NULL; if (flags & WQ_UNBOUND) { - wq->unbound_attrs = alloc_workqueue_attrs_noprof(); - if (!wq->unbound_attrs) + wq->attrs = alloc_workqueue_attrs_noprof(); + if (!wq->attrs) goto err_free_wq; } @@ -5999,7 +5999,7 @@ static struct workqueue_struct *__alloc_workqueue(const char *fmt, free_node_nr_active(wq->node_nr_active); } err_free_wq: - free_workqueue_attrs(wq->unbound_attrs); + free_workqueue_attrs(wq->attrs); kfree(wq); return NULL; err_unlock_destroy: @@ -6943,7 +6943,7 @@ int workqueue_online_cpu(unsigned int cpu) /* update pod affinity of unbound workqueues */ list_for_each_entry(wq, &workqueues, list) { - struct workqueue_attrs *attrs = wq->unbound_attrs; + struct workqueue_attrs *attrs = wq->attrs; if (wq->flags & WQ_UNBOUND) { const struct wq_pod_type *pt = wqattrs_pod_type(attrs); @@ -6978,7 +6978,7 @@ int workqueue_offline_cpu(unsigned int cpu) cpumask_clear_cpu(cpu, wq_online_cpumask); list_for_each_entry(wq, &workqueues, list) { - struct workqueue_attrs *attrs = wq->unbound_attrs; + struct workqueue_attrs *attrs = wq->attrs; if (wq->flags & WQ_UNBOUND) { const struct wq_pod_type *pt = wqattrs_pod_type(attrs); @@ -7158,7 +7158,7 @@ static int workqueue_apply_unbound_cpumask(const cpumask_var_t unbound_cpumask) if (!(wq->flags & WQ_UNBOUND) || (wq->flags & __WQ_DESTROYING)) continue; - ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs, unbound_cpumask); + ctx = apply_wqattrs_prepare(wq, wq->attrs, unbound_cpumask); if (IS_ERR(ctx)) { ret = PTR_ERR(ctx); break; @@ -7376,7 +7376,7 @@ static ssize_t wq_nice_show(struct device *dev, struct device_attribute *attr, int written; mutex_lock(&wq->mutex); - written = scnprintf(buf, PAGE_SIZE, "%d\n", wq->unbound_attrs->nice); + written = scnprintf(buf, PAGE_SIZE, "%d\n", wq->attrs->nice); mutex_unlock(&wq->mutex); return written; @@ -7393,7 +7393,7 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq) if (!attrs) return NULL; - copy_workqueue_attrs(attrs, wq->unbound_attrs); + copy_workqueue_attrs(attrs, wq->attrs); return attrs; } @@ -7430,7 +7430,7 @@ static ssize_t wq_cpumask_show(struct device *dev, mutex_lock(&wq->mutex); written = scnprintf(buf, PAGE_SIZE, "%*pb\n", - cpumask_pr_args(wq->unbound_attrs->cpumask)); + cpumask_pr_args(wq->attrs->cpumask)); mutex_unlock(&wq->mutex); return written; } @@ -7466,13 +7466,13 @@ static ssize_t wq_affn_scope_show(struct device *dev, int written; mutex_lock(&wq->mutex); - if (wq->unbound_attrs->affn_scope == WQ_AFFN_DFL) + if (wq->attrs->affn_scope == WQ_AFFN_DFL) written = scnprintf(buf, PAGE_SIZE, "%s (%s)\n", wq_affn_names[WQ_AFFN_DFL], wq_affn_names[wq_affn_dfl]); else written = scnprintf(buf, PAGE_SIZE, "%s\n", - wq_affn_names[wq->unbound_attrs->affn_scope]); + wq_affn_names[wq->attrs->affn_scope]); mutex_unlock(&wq->mutex); return written; @@ -7507,7 +7507,7 @@ static ssize_t wq_affinity_strict_show(struct device *dev, struct workqueue_struct *wq = dev_to_wq(dev); return scnprintf(buf, PAGE_SIZE, "%d\n", - wq->unbound_attrs->affn_strict); + wq->attrs->affn_strict); } static ssize_t wq_affinity_strict_store(struct device *dev, @@ -7680,7 +7680,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq) dev_set_name(&wq_dev->dev, "%s", wq->name); /* - * unbound_attrs are created separately. Suppress uevent until + * attrs are created separately. Suppress uevent until * everything is ready. */ dev_set_uevent_suppress(&wq_dev->dev, true); diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index a0c72237531f9..e0a6936a2a37f 100644 --- a/tools/workqueue/wq_dump.py +++ b/tools/workqueue/wq_dump.py @@ -85,7 +85,7 @@ def wq_type_str(wq): if wq.flags & WQ_ORDERED: return f'{"ordered":{wq_type_len}}' else: - if wq.unbound_attrs.affn_strict: + if wq.attrs.affn_strict: return f'{"unbound,S":{wq_type_len}}' else: return f'{"unbound":{wq_type_len}}' @@ -205,8 +205,8 @@ 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.unbound_attrs.value_() != 0: - print(f' {cpumask_str(wq.unbound_attrs.cpumask):{ucpus_len}}', end='') + if wq.attrs.value_() != 0: + print(f' {cpumask_str(wq.attrs.cpumask):{ucpus_len}}', end='') else: print(f' {"":{ucpus_len}}', end='') -- 2.53.0-Meta