Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

From: Tejun Heo
Date: Mon Apr 27 2015 - 23:44:49 EST


Hello,

On Tue, Apr 28, 2015 at 09:44:44AM +0800, Lai Jiangshan wrote:
> >> +int workqueue_set_unbound_cpumask(cpumask_var_t cpumask);
> >
> > Why is this a public function?
>
>
> In V4 patchset, Kevin Hilman had requested the wq_unbound_cpumask
> to be "cpumask_complement(wq_unbound_cpumask, tick_nohz_full_mask);"
>
> I replied against it and I suggested that wq_unbound_cpumask can be
> re-set after workqueue initialized it.
>
> And Frederic Weisbecker seemed on my side:
> """
> If it should be the default on NO_HZ_FULL, maybe we should do this from the
> tick nohz code. Some late or fs initcall that will do the workqueue affinity,
> timer affinity, etc...
> """
>
> So, we need an API to modify the wq_unbound_cpumask, and I provided
> this public function. Otherwise, the other code can't modify it.

I see. I don't have too strong an opinion; however, changing the mask
is a fairly heavy operation. Are there specific reasons why we don't
want to follow the nohz config right away? Also, even if we do it
this way, the function doesn't need to be EXPORT_SYMBOL_GPL()'d,
right?

> > Is the following list_del() necessary? The list is never used again,
> > right?
>
> It isn't necessary. It was added in V7. I thought it could make
> the code more normal.

The problem with doing unnecessary stuff is that it's bound to be
inconsistent and makes the reader wonder whether something else which
requires such extra operation is going on when there's none. It tends
to mislead than anything else.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/