Re: [2.6.31-rc9] hotplug SATA vs lockdep: false positive?

From: Peter Zijlstra
Date: Fri Sep 11 2009 - 07:38:45 EST


On Fri, 2009-09-11 at 09:59 +0800, Ming Lei wrote:
>
> IMHO, it seems flushing other workqueues in one workqueue, so it
> may be a false positive. Since the three workqueue instances share one
> lock class, maybe lockdep_set_class*() or other similar annotations
> is needed in acpi_os_initialize1() to avoid the warning.

Hrm.. this code hurts brain..

I count 3 workqueues, kacpi_notify_wq, kacpid_wq and kacpi_hotplug_wq.

And we have:

void acpi_os_wait_events_complete(void *context)
{
flush_workqueue(kacpid_wq);
flush_workqueue(kacpi_notify_wq);
}

So we're calling this from the hotplug queue, and flush the other two
acpi wqs?

1) are we sure all this flushing is indeed needed, can't driver .remove
methods use cancel_work() instead?

2) ugh..

Yeah, your problem is that you've overloaded this __acpi_os_execute()
thing and enqueue work to all 3 workqueues using the very same
INIT_WORK() instance.

Untangle that mess a bit and use multiple INIT_WORK() stmts.

Why do you need 3 queues to run 2 functions?

--
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/