Re: [PATCH v6 1/2] smpboot: allow excluding cpus from the smpboot threads

Thomas Gleixner
2015-04-08T20:37:34Z

On Wed, 8 Apr 2015, cmetcalf@ezchip.com wrote:
> @@ -173,6 +173,9 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu)
> if (tsk)
> return 0;
>
> + if (ht->valid_cpu && !ht->valid_cpu(cpu))
> + return 0;
> +
> td = kzalloc_node(sizeof(*td), GFP_KERNEL, cpu_to_node(cpu));
> if (!td)
> return -ENOMEM;
> @@ -221,9 +224,11 @@ static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cp
> {
> struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu);
>
> - if (ht->pre_unpark)
> - ht->pre_unpark(cpu);
> - kthread_unpark(tsk);
> + if (tsk) {
> + if (ht->pre_unpark)
> + ht->pre_unpark(cpu);
> + kthread_unpark(tsk);
> + }

This is a very watchdog centric implementation. The watchdog actually
can afford to unregister/register the per cpu threads when the mask
changes, but other facilities might not.

So I'd like to see the threads still created and have the valid cpu
check in the unpark function. That way you can just park/unpark a
particular per cpu thread when the mask changes and you are not forced
to teardown/reenable the whole facility.

Thanks,

tglx