Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756986AbXLGXCW (ORCPT ); Fri, 7 Dec 2007 18:02:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754394AbXLGXCM (ORCPT ); Fri, 7 Dec 2007 18:02:12 -0500 Received: from py-out-1112.google.com ([64.233.166.179]:59116 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752875AbXLGXCK (ORCPT ); Fri, 7 Dec 2007 18:02:10 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:mime-version:content-type:x-google-sender-auth; b=kqLV6rF8R6LhV0JAk1PYqeZrUt3dGxl6hBdMOl2Jz3wRavCeGo82CRsfGEetoV5Nug9aD8YEcrgm5uV3h9GwMNivX/4/b1swIGvlJYv1VDT0/iWG1bW1Y2HKDhCktYJRL3+91VOOsG3Hwut1BGxXHJst1GbyaXQPlq0Z0SkHO1M= Message-ID: <3efb10970712071502p4db9c58ck623c377172ead4b2@mail.gmail.com> Date: Sat, 8 Dec 2007 00:02:08 +0100 From: "Remy Bohmer" To: "Peter Zijlstra" Subject: lockdep problem conversion semaphore->mutex (dev->sem) Cc: "Daniel Walker" , "Ingo Molnar" , "Steven Rostedt" , linux-kernel , "Dave Chinner" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_16938_17418860.1197068528220" X-Google-Sender-Auth: f696e90883f2286d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 43950 Lines: 626 ------=_Part_16938_17418860.1197068528220 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello Peter, > > What specifically is wrong with dev->sem ? > > Nothing really, other than that they use semaphores to avoid lockdep :-/ > > I think I know how to annotate this, after Alan Stern explained all the > use cases, but I haven't come around to implementing it. Hope to do that > soonish. I was looking for an easy semaphore I could convert to a mutex, and I ran into one that was widely spread and interesting, and which seemed quite doable at first sight. So, I started working on it, but was forgotten this discussion, (until Daniel made me remember it this afternoon). So, I (stupid me ;-) ) tried to convert dev->sem... After doing the monkey part of the conversion I can boot the kernel completely on X86 and ARM, and everything works fine, except after enabling lockdep, lockdep starts complaining... Is this the problem you were pointing at? ======================================================= Setting up standard PCI resources ACPI: EC: Look up EC in DSDT ACPI: Interpreter enabled ACPI: (supports S0 S1 S3 S4 S5) ACPI: Using IOAPIC for interrupt routing ============================================= [ INFO: possible recursive locking detected ] 2.6.24-rc4 #5 --------------------------------------------- swapper/1 is trying to acquire lock: (&dev->mut){--..}, at: [] __driver_attach+0x2c/0x5f but task is already holding lock: (&dev->mut){--..}, at: [] __driver_attach+0x1d/0x5f other info that might help us debug this: 1 lock held by swapper/1: #0: (&dev->mut){--..}, at: [] __driver_attach+0x1d/0x5f stack backtrace: Pid: 1, comm: swapper Not tainted 2.6.24-rc4 #5 [] __lock_acquire+0x17b/0xb83 [] trace_hardirqs_on+0x11a/0x13d [] lock_acquire+0x5f/0x77 [] __driver_attach+0x2c/0x5f [] mutex_lock_nested+0x105/0x26b [] __driver_attach+0x2c/0x5f [] __driver_attach+0x2c/0x5f [] __driver_attach+0x0/0x5f [] __driver_attach+0x2c/0x5f [] bus_for_each_dev+0x3a/0x5c [] driver_attach+0x16/0x18 [] __driver_attach+0x0/0x5f [] bus_add_driver+0x6d/0x19a [] acpi_ec_init+0x33/0x51 [] kernel_init+0x148/0x2af [] kernel_init+0x0/0x2af [] kernel_init+0x0/0x2af [] kernel_thread_helper+0x7/0x10 ======================= ACPI: PCI Root Bridge [PCI0] (0000:00) Force enabled HPET at base address 0xfed00000 ======================================================= I tried debugging it, and I have not found a recursive mutex locking so far, only locking of 2 different mutexes in a row prior to this warning, which IMO should be valid. What is your opinion? BTW: I attached my patch for dev->sem as I have it now, that generates this lockdep warning ( for if you want to look at it yourself also, so you do not have to do the monkey part yourself anymore ;-) Kind Regards, Remy ------=_Part_16938_17418860.1197068528220 Content-Type: application/octet-stream; name=patch_replace_sem_by_mutex_in_device_h Content-Transfer-Encoding: base64 X-Attachment-Id: f_f9xbeuzg Content-Disposition: attachment; filename=patch_replace_sem_by_mutex_in_device_h U3ViamVjdDogU2VtYXBob3JlIHRvIE11dGV4IGluIHN0cnVjdCBkZXZpY2UKClRoZSBzZW1hcGhv cmUgaW4gaW5jbHVkZS9saW51eC9kZXZpY2UuaCBpcyB1c2VkIGFzIGEgbXV0ZXgKU28sIHJlcGxh Y2luZyBpdCBieSBhIG11dGV4IGV2ZXJ5d2hlcmUgaW4gdGhlIHRyZWUuCkFsc28gcmVuYW1lZCBz ZW0tPm11dCwgdG8gbWFrZSBzdXJlIGFsbCBvdXQtb2YtdHJlZSBtb2R1bGVzCnRoYXQgdXNlIHRo aXMgc2VtYXBob3JlIHdpbGwgYWxzbyBiZSBjb252ZXJ0ZWQuCgpTaWduZWQtb2ZmLWJ5OiBSZW15 IEJvaG1lciA8bGludXhAYm9obWVyLm5ldD4KCi0tLQogZHJpdmVycy9iYXNlL2J1cy5jICAgICAg ICAgICAgICAgIHwgICAyMCArKysrKysrLS0tLS0tLQogZHJpdmVycy9iYXNlL2NsYXNzLmMgICAg ICAgICAgICAgIHwgICAyMiArKysrKysrLS0tLS0tLS0KIGRyaXZlcnMvYmFzZS9jb3JlLmMgICAg ICAgICAgICAgICB8ICAgMjAgKysrKysrLS0tLS0tLS0KIGRyaXZlcnMvYmFzZS9kZC5jICAgICAg ICAgICAgICAgICB8ICAgMzggKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tCiBkcml2ZXJzL2Jh c2UvcG93ZXIvbWFpbi5jICAgICAgICAgfCAgICA4ICsrLS0tCiBkcml2ZXJzL2ZpcmV3aXJlL2Z3 LWRldmljZS5jICAgICAgfCAgICA0ICstCiBkcml2ZXJzL2llZWUxMzk0L25vZGVtZ3IuYyAgICAg ICAgfCAgIDUzICsrKysrKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLS0tCiBkcml2ZXJz L3BjaS9idXMuYyAgICAgICAgICAgICAgICAgfCAgICA0ICstCiBkcml2ZXJzL3BjbWNpYS9kcy5j ICAgICAgICAgICAgICAgfCAgICA4ICsrLS0tCiBkcml2ZXJzL3Bvd2VyL2FwbV9wb3dlci5jICAg ICAgICAgfCAgICA2ICsrLS0KIGRyaXZlcnMvcG93ZXIvcG93ZXJfc3VwcGx5X2NvcmUuYyB8ICAg IDggKystLS0KIGRyaXZlcnMvcnRjL2ludGVyZmFjZS5jICAgICAgICAgICB8ICAgIDQgKy0KIGRy aXZlcnMvc2NzaS9ob3N0cy5jICAgICAgICAgICAgICB8ICAgIDQgKy0KIGRyaXZlcnMvc3BpL3Nw aS5jICAgICAgICAgICAgICAgICB8ICAgIDQgKy0KIGRyaXZlcnMvdXNiL2NvcmUvaHViLmMgICAg ICAgICAgICB8ICAgIDYgKystLQogaW5jbHVkZS9saW51eC9kZXZpY2UuaCAgICAgICAgICAgIHwg ICAgNiArKy0tCiBpbmNsdWRlL2xpbnV4L3VzYi5oICAgICAgICAgICAgICAgfCAgICA2ICsrLS0K IDE3IGZpbGVzIGNoYW5nZWQsIDExMCBpbnNlcnRpb25zKCspLCAxMTEgZGVsZXRpb25zKC0pCgpJ bmRleDogbGludXgtMi42LjI0LXJjNC9pbmNsdWRlL2xpbnV4L2RldmljZS5oCj09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K LS0tIGxpbnV4LTIuNi4yNC1yYzQub3JpZy9pbmNsdWRlL2xpbnV4L2RldmljZS5oCTIwMDctMTIt MDcgMDA6MTE6NTguMDAwMDAwMDAwICswMTAwCisrKyBsaW51eC0yLjYuMjQtcmM0L2luY2x1ZGUv bGludXgvZGV2aWNlLmgJMjAwNy0xMi0wNyAxMDozNTowOS4wMDAwMDAwMDAgKzAxMDAKQEAgLTE4 MCw3ICsxODAsOSBAQCBzdHJ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wog CQl9CiAJfQotCXVwKCZzcGlfbWFzdGVyX2NsYXNzLnNlbSk7CisJbXV0ZXhfdW5sb2NrKCZzcGlf bWFzdGVyX2NsYXNzLm11dCk7CiAJcmV0dXJuIG1hc3RlcjsKIH0KIEVYUE9SVF9TWU1CT0xfR1BM KHNwaV9idXNudW1fdG9fbWFzdGVyKTsK ------=_Part_16938_17418860.1197068528220-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/