* [PATCH -next v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu()
@ 2024-09-04 2:26 Hongbo Li
2024-11-14 7:38 ` Christophe Leroy
0 siblings, 1 reply; 3+ messages in thread
From: Hongbo Li @ 2024-09-04 2:26 UTC (permalink / raw)
To: christophe.leroy; +Cc: lihongbo22, linuxppc-dev, linux-arm-kernel
Replace kthread_create/kthread_bind/wake_up_process() with
kthread_run_on_cpu() to simplify the code.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
v2:
- Remove the extra parameter to solve the compilation.
- Change cpu from int type to unsigned int type.
v1: https://lore.kernel.org/linux-arm-kernel/20240902133125.3089560-1-lihongbo22@huawei.com/T/
---
drivers/soc/fsl/qbman/qman_test_stash.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c
index b7e8e5ec884c..639acaf6ce18 100644
--- a/drivers/soc/fsl/qbman/qman_test_stash.c
+++ b/drivers/soc/fsl/qbman/qman_test_stash.c
@@ -101,21 +101,19 @@ static int bstrap_fn(void *bs)
}
static int on_all_cpus(int (*fn)(void))
{
- int cpu;
+ unsigned int cpu;
for_each_cpu(cpu, cpu_online_mask) {
struct bstrap bstrap = {
.fn = fn,
.started = ATOMIC_INIT(0)
};
- struct task_struct *k = kthread_create(bstrap_fn, &bstrap,
- "hotpotato%d", cpu);
+ struct task_struct *k = kthread_run_on_cpu(bstrap_fn, &bstrap,
+ cpu, "hotpotato%u");
int ret;
if (IS_ERR(k))
return -ENOMEM;
- kthread_bind(k, cpu);
- wake_up_process(k);
/*
* If we call kthread_stop() before the "wake up" has had an
* effect, then the thread may exit with -EINTR without ever
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu()
2024-09-04 2:26 [PATCH -next v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu() Hongbo Li
@ 2024-11-14 7:38 ` Christophe Leroy
2024-11-14 11:25 ` Frederic Weisbecker
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2024-11-14 7:38 UTC (permalink / raw)
To: Hongbo Li, Frederic Weisbecker; +Cc: linuxppc-dev, linux-arm-kernel
Hi,
Le 04/09/2024 à 04:26, Hongbo Li a écrit :
> Replace kthread_create/kthread_bind/wake_up_process() with
> kthread_run_on_cpu() to simplify the code.
>
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
A similar change is proposed as part of a larger series, see patch 7 in
that series
https://lore.kernel.org/lkml/20241112142248.20503-1-frederic@kernel.org/
I prefer to leave this patch aside and not interfere with Frederic's work.
Christophe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu()
2024-11-14 7:38 ` Christophe Leroy
@ 2024-11-14 11:25 ` Frederic Weisbecker
0 siblings, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2024-11-14 11:25 UTC (permalink / raw)
To: Christophe Leroy; +Cc: Hongbo Li, linuxppc-dev, linux-arm-kernel
Le Thu, Nov 14, 2024 at 08:38:59AM +0100, Christophe Leroy a écrit :
> Hi,
>
> Le 04/09/2024 à 04:26, Hongbo Li a écrit :
> > Replace kthread_create/kthread_bind/wake_up_process() with
> > kthread_run_on_cpu() to simplify the code.
> >
> > Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
>
> A similar change is proposed as part of a larger series, see patch 7 in that
> series
> https://lore.kernel.org/lkml/20241112142248.20503-1-frederic@kernel.org/
>
> I prefer to leave this patch aside and not interfere with Frederic's work.
Speaking of, feel free to take it, the conversions to kthread_run_on_cpu()
are standalone patches.
Thanks.
>
> Christophe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-14 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 2:26 [PATCH -next v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu() Hongbo Li
2024-11-14 7:38 ` Christophe Leroy
2024-11-14 11:25 ` Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).