From: Valentin Schneider <vschneid@redhat•com>
To: Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
Linux Next Mailing List <linux-next@vger•kernel.org>
Cc: Stephen Rothwell <sfr@canb•auug.org.au>,
Tejun Heo <tj@kernel•org>, Lai Jiangshan <jiangshanlai@gmail•com>
Subject: [PATCH] workqueue: Fold rebind_worker() within rebind_workers()
Date: Fri, 13 Jan 2023 17:40:40 +0000 [thread overview]
Message-ID: <20230113174040.1344293-1-vschneid@redhat.com> (raw)
!CONFIG_SMP builds complain about rebind_worker() being unused. Its only
user, rebind_workers() is indeed only defined for CONFIG_SMP, so just fold
the two lines back up there.
Link: http://lore.kernel.org/r/20230113143102.2e94d74f@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Signed-off-by: Valentin Schneider <vschneid@redhat•com>
---
kernel/workqueue.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0d44c33b5b24e..dce29154cd07a 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1986,12 +1986,6 @@ static void unbind_worker(struct worker *worker)
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_possible_mask) < 0);
}
-static void rebind_worker(struct worker *worker, struct worker_pool *pool)
-{
- kthread_set_per_cpu(worker->task, pool->cpu);
- WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask) < 0);
-}
-
static void wake_dying_workers(struct list_head *cull_list)
{
struct worker *worker, *tmp;
@@ -5149,8 +5143,11 @@ static void rebind_workers(struct worker_pool *pool)
* of all workers first and then clear UNBOUND. As we're called
* from CPU_ONLINE, the following shouldn't fail.
*/
- for_each_pool_worker(worker, pool)
- rebind_worker(worker, pool);
+ for_each_pool_worker(worker, pool) {
+ kthread_set_per_cpu(worker->task, pool->cpu);
+ WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task,
+ pool->attrs->cpumask) < 0);
+ }
raw_spin_lock_irq(&pool->lock);
--
2.31.1
next reply other threads:[~2023-01-13 17:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 17:40 Valentin Schneider [this message]
2023-01-13 17:51 ` [PATCH] workqueue: Fold rebind_worker() within rebind_workers() Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230113174040.1344293-1-vschneid@redhat.com \
--to=vschneid@redhat$(echo .)com \
--cc=jiangshanlai@gmail$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=tj@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox