Re: [PATCH v2] sched/isolation: add a workqueue parameter to constrain unbound CPUs

From: Yuanhan Zhang
Date: Wed Jun 21 2023 - 23:47:26 EST


Tejun Heo <tj@xxxxxxxxxx> 于2023年6月22日周四 04:51写道:
>
> On Wed, Jun 14, 2023 at 05:19:45PM +0800, tiozhang wrote:
> ...
> > @@ -181,8 +181,8 @@ static int __init housekeeping_nohz_full_setup(char *str)
> > {
> > unsigned long flags;
> >
> > - flags = HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU |
> > - HK_FLAG_MISC | HK_FLAG_KTHREAD;
> > + flags = HK_FLAG_TICK | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC
> > + | HK_FLAG_KTHREAD;
>
> Why is WQ being taken out of nohz_full setup? The patch description doesn't
> mention anything.

To prevent nohz_full from rewriting workqueue's choice. Add a
description in patch v3.

>
> > @@ -208,6 +208,12 @@ static int __init housekeeping_isolcpus_setup(char *str)
> > continue;
> > }
> >
> > + if (!strncmp(str, "workqueue,", 10)) {
> > + str += 10;
> > + flags |= HK_FLAG_WQ;
> > + continue;
> > + }
>
> I wonder whether it'd be better to just add a workqueue boot param but if

I also write a patch this way, please see '[PATCH] workqueue: add
cmdline parameter
`unbound_workqueue_cpus` to further constrain wq_unbound_cpumask at boot time'.
If you think it is better I'm happy to continue on this :)

> this works it's fine too.

It works since we use this cpumask to constrain wq_unbound_cpumask in
workqueue's early init.

>
> Thanks.
>
> --
> tejun

Thank you,
tiozhang