Re: [PATCH 07/19] acpi: use queue_work_on() instead of bindingworkqueue worker to cpu0

From: Andrew Morton
Date: Fri Nov 20 2009 - 00:11:48 EST


On Fri, 20 Nov 2009 13:46:35 +0900 Tejun Heo <tj@xxxxxxxxxx> wrote:

> ACPI works need to be executed on cpu0 and acpi/osl.c achieves this by
> creating singlethread workqueue and then binding it to cpu0 from a
> work which is quite unorthodox. Make it create regular workqueues and
> use queue_work_on() instead. This is in preparation of concurrency
> managed workqueue and the extra workers won't be a problem after it's
> implemented.
>
> ...
>
> acpi_status acpi_os_initialize1(void)
> {
> - /*
> - * On some machines, a software-initiated SMI causes corruption unless
> - * the SMI runs on CPU 0. An SMI can be initiated by any AML, but
> - * typically it's done in GPE-related methods that are run via
> - * workqueues, so we can avoid the known corruption cases by binding
> - * the workqueues to CPU 0.
> - */
> - kacpid_wq = create_singlethread_workqueue("kacpid");
> - bind_workqueue(kacpid_wq);
> - kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
> - bind_workqueue(kacpi_notify_wq);
> - kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug");
> - bind_workqueue(kacpi_hotplug_wq);
> + kacpid_wq = create_workqueue("kacpid");
> + kacpi_notify_wq = create_workqueue("kacpi_notify");
> + kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");

Well that sucks. We create an additional ((num_possible_cpus()-1)*3)
kernel threads just because the previous code was "unorthodox"?

I guess that problem goes away with concurrency-managed workqueues.
But please let's not merge this patch without also merging
concurrency-managed workqueues!
--
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/