* select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock @ 2011-08-04 14:13 Sergey Senozhatsky 2011-08-04 15:05 ` Peter Zijlstra 0 siblings, 1 reply; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-04 14:13 UTC (permalink / raw) To: Ingo Molnar Cc: Peter Zijlstra, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm Hello, Got the following trace on 3.0-git19 (07865-g1280ea8): [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() [ 132.794687] Hardware name: Aspire 5741G [ 132.794689] Modules linked in: kvm_intel kvm tun ipv6 microcode snd_hda_codec_hdmi snd_hda_codec_realtek broadcom snd_hda_intel snd_hda_codec tg3 snd_pcm snd_timer snd soundcore acer_wmi evdev libphy sparse_keymap psmouse snd_page_alloc pcspkr battery ac wmi button ehci_hcd sr_mod cdrom usbcore sd_mod ahci [ 132.794731] Pid: 4029, comm: qemu-system-x86 Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668 [ 132.794733] Call Trace: [ 132.794736] <IRQ> [<ffffffff8103e4e0>] warn_slowpath_common+0x7e/0x96 [ 132.794744] [<ffffffff8103e50d>] warn_slowpath_null+0x15/0x17 [ 132.794748] [<ffffffff8106dcee>] match_held_lock+0xf6/0x12e [ 132.794751] [<ffffffff8106dd88>] lock_is_held+0x62/0xa6 [ 132.794757] [<ffffffff81086471>] cgroup_lock_is_held+0x10/0x12 [ 132.794762] [<ffffffff810368a2>] set_task_cpu+0x1ac/0x3e3 [ 132.794766] [<ffffffff8103856a>] ? select_task_rq_fair+0x5c0/0x9ca [ 132.794769] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b [ 132.794773] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b [ 132.794779] [<ffffffff812552a5>] ? do_raw_spin_lock+0x6b/0x122 [ 132.794783] [<ffffffff81037603>] try_to_wake_up+0x19f/0x28b [ 132.794787] [<ffffffff810603ed>] ? update_rmtp+0x65/0x65 [ 132.794790] [<ffffffff8103770e>] wake_up_process+0x10/0x12 [ 132.794794] [<ffffffff8106040a>] hrtimer_wakeup+0x1d/0x21 [ 132.794797] [<ffffffff81060816>] __run_hrtimer+0x1b1/0x372 [ 132.794800] [<ffffffff810613a2>] hrtimer_interrupt+0xe6/0x1b0 [ 132.794805] [<ffffffff810185d5>] smp_apic_timer_interrupt+0x80/0x93 [ 132.794810] [<ffffffff81493af3>] apic_timer_interrupt+0x73/0x80 [ 132.794812] <EOI> [<ffffffff810fb998>] ? do_mmu_notifier_register+0x66/0x125 [ 132.794822] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 [ 132.794826] [<ffffffff810ec160>] ? mm_take_all_locks+0x139/0x165 [ 132.794829] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 [ 132.794832] [<ffffffff810fb9a0>] do_mmu_notifier_register+0x6e/0x125 [ 132.794836] [<ffffffff810fba72>] mmu_notifier_register+0xe/0x10 [ 132.794852] [<ffffffffa01fcc0d>] kvm_dev_ioctl+0x297/0x400 [kvm] [ 132.794857] [<ffffffff81119022>] do_vfs_ioctl+0x46c/0x4ad [ 132.794862] [<ffffffff8110a68d>] ? fget_light+0xed/0x2a7 [ 132.794867] [<ffffffff81492fca>] ? sysret_check+0x2e/0x69 [ 132.794871] [<ffffffff811190b4>] sys_ioctl+0x51/0x75 [ 132.794875] [<ffffffff81492f92>] system_call_fastpath+0x16/0x1b [ 132.794877] ---[ end trace 298584c4014cd2b8 ]--- Sergey -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 14:13 select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock Sergey Senozhatsky @ 2011-08-04 15:05 ` Peter Zijlstra 2011-08-04 15:13 ` Peter Zijlstra 2011-08-04 15:37 ` Sergey Senozhatsky 0 siblings, 2 replies; 11+ messages in thread From: Peter Zijlstra @ 2011-08-04 15:05 UTC (permalink / raw) To: Sergey Senozhatsky Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On Thu, 2011-08-04 at 17:13 +0300, Sergey Senozhatsky wrote: > Hello, > Got the following trace on 3.0-git19 (07865-g1280ea8): > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > [ 132.794687] Hardware name: Aspire 5741G > [ 132.794689] Modules linked in: kvm_intel kvm tun ipv6 microcode snd_hda_codec_hdmi snd_hda_codec_realtek broadcom snd_hda_intel snd_hda_codec tg3 snd_pcm snd_timer snd soundcore acer_wmi evdev libphy sparse_keymap psmouse snd_page_alloc > pcspkr battery ac wmi button ehci_hcd sr_mod cdrom usbcore sd_mod ahci > [ 132.794731] Pid: 4029, comm: qemu-system-x86 Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668 > [ 132.794733] Call Trace: > [ 132.794736] <IRQ> [<ffffffff8103e4e0>] warn_slowpath_common+0x7e/0x96 > [ 132.794744] [<ffffffff8103e50d>] warn_slowpath_null+0x15/0x17 > [ 132.794748] [<ffffffff8106dcee>] match_held_lock+0xf6/0x12e > [ 132.794751] [<ffffffff8106dd88>] lock_is_held+0x62/0xa6 > [ 132.794757] [<ffffffff81086471>] cgroup_lock_is_held+0x10/0x12 > [ 132.794762] [<ffffffff810368a2>] set_task_cpu+0x1ac/0x3e3 > [ 132.794766] [<ffffffff8103856a>] ? select_task_rq_fair+0x5c0/0x9ca > [ 132.794769] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > [ 132.794773] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > [ 132.794779] [<ffffffff812552a5>] ? do_raw_spin_lock+0x6b/0x122 > [ 132.794783] [<ffffffff81037603>] try_to_wake_up+0x19f/0x28b > [ 132.794787] [<ffffffff810603ed>] ? update_rmtp+0x65/0x65 > [ 132.794790] [<ffffffff8103770e>] wake_up_process+0x10/0x12 > [ 132.794794] [<ffffffff8106040a>] hrtimer_wakeup+0x1d/0x21 > [ 132.794797] [<ffffffff81060816>] __run_hrtimer+0x1b1/0x372 > [ 132.794800] [<ffffffff810613a2>] hrtimer_interrupt+0xe6/0x1b0 > [ 132.794805] [<ffffffff810185d5>] smp_apic_timer_interrupt+0x80/0x93 > [ 132.794810] [<ffffffff81493af3>] apic_timer_interrupt+0x73/0x80 > [ 132.794812] <EOI> [<ffffffff810fb998>] ? do_mmu_notifier_register+0x66/0x125 > [ 132.794822] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > [ 132.794826] [<ffffffff810ec160>] ? mm_take_all_locks+0x139/0x165 > [ 132.794829] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > [ 132.794832] [<ffffffff810fb9a0>] do_mmu_notifier_register+0x6e/0x125 > [ 132.794836] [<ffffffff810fba72>] mmu_notifier_register+0xe/0x10 > [ 132.794852] [<ffffffffa01fcc0d>] kvm_dev_ioctl+0x297/0x400 [kvm] > [ 132.794857] [<ffffffff81119022>] do_vfs_ioctl+0x46c/0x4ad > [ 132.794862] [<ffffffff8110a68d>] ? fget_light+0xed/0x2a7 > [ 132.794867] [<ffffffff81492fca>] ? sysret_check+0x2e/0x69 > [ 132.794871] [<ffffffff811190b4>] sys_ioctl+0x51/0x75 > [ 132.794875] [<ffffffff81492f92>] system_call_fastpath+0x16/0x1b > [ 132.794877] ---[ end trace 298584c4014cd2b8 ]--- Curious, how easy is that to reproduce? That really shouldn't happen and its not immediately obvious how it could happen. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:05 ` Peter Zijlstra @ 2011-08-04 15:13 ` Peter Zijlstra 2011-08-04 15:37 ` Sergey Senozhatsky 1 sibling, 0 replies; 11+ messages in thread From: Peter Zijlstra @ 2011-08-04 15:13 UTC (permalink / raw) To: Sergey Senozhatsky Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On Thu, 2011-08-04 at 17:05 +0200, Peter Zijlstra wrote: > On Thu, 2011-08-04 at 17:13 +0300, Sergey Senozhatsky wrote: > > Hello, > > Got the following trace on 3.0-git19 (07865-g1280ea8): > > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > > [ 132.794687] Hardware name: Aspire 5741G > > [ 132.794689] Modules linked in: kvm_intel kvm tun ipv6 microcode snd_hda_codec_hdmi snd_hda_codec_realtek broadcom snd_hda_intel snd_hda_codec tg3 snd_pcm snd_timer snd soundcore acer_wmi evdev libphy sparse_keymap psmouse snd_page_alloc > > pcspkr battery ac wmi button ehci_hcd sr_mod cdrom usbcore sd_mod ahci > > [ 132.794731] Pid: 4029, comm: qemu-system-x86 Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668 > > [ 132.794733] Call Trace: > > [ 132.794736] <IRQ> [<ffffffff8103e4e0>] warn_slowpath_common+0x7e/0x96 > > [ 132.794744] [<ffffffff8103e50d>] warn_slowpath_null+0x15/0x17 > > [ 132.794748] [<ffffffff8106dcee>] match_held_lock+0xf6/0x12e > > [ 132.794751] [<ffffffff8106dd88>] lock_is_held+0x62/0xa6 > > [ 132.794757] [<ffffffff81086471>] cgroup_lock_is_held+0x10/0x12 > > [ 132.794762] [<ffffffff810368a2>] set_task_cpu+0x1ac/0x3e3 > > [ 132.794766] [<ffffffff8103856a>] ? select_task_rq_fair+0x5c0/0x9ca > > [ 132.794769] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > > [ 132.794773] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > > [ 132.794779] [<ffffffff812552a5>] ? do_raw_spin_lock+0x6b/0x122 > > [ 132.794783] [<ffffffff81037603>] try_to_wake_up+0x19f/0x28b > > [ 132.794787] [<ffffffff810603ed>] ? update_rmtp+0x65/0x65 > > [ 132.794790] [<ffffffff8103770e>] wake_up_process+0x10/0x12 > > [ 132.794794] [<ffffffff8106040a>] hrtimer_wakeup+0x1d/0x21 > > [ 132.794797] [<ffffffff81060816>] __run_hrtimer+0x1b1/0x372 > > [ 132.794800] [<ffffffff810613a2>] hrtimer_interrupt+0xe6/0x1b0 > > [ 132.794805] [<ffffffff810185d5>] smp_apic_timer_interrupt+0x80/0x93 > > [ 132.794810] [<ffffffff81493af3>] apic_timer_interrupt+0x73/0x80 > > [ 132.794812] <EOI> [<ffffffff810fb998>] ? do_mmu_notifier_register+0x66/0x125 > > [ 132.794822] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > > [ 132.794826] [<ffffffff810ec160>] ? mm_take_all_locks+0x139/0x165 > > [ 132.794829] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > > [ 132.794832] [<ffffffff810fb9a0>] do_mmu_notifier_register+0x6e/0x125 > > [ 132.794836] [<ffffffff810fba72>] mmu_notifier_register+0xe/0x10 > > [ 132.794852] [<ffffffffa01fcc0d>] kvm_dev_ioctl+0x297/0x400 [kvm] > > [ 132.794857] [<ffffffff81119022>] do_vfs_ioctl+0x46c/0x4ad > > [ 132.794862] [<ffffffff8110a68d>] ? fget_light+0xed/0x2a7 > > [ 132.794867] [<ffffffff81492fca>] ? sysret_check+0x2e/0x69 > > [ 132.794871] [<ffffffff811190b4>] sys_ioctl+0x51/0x75 > > [ 132.794875] [<ffffffff81492f92>] system_call_fastpath+0x16/0x1b > > [ 132.794877] ---[ end trace 298584c4014cd2b8 ]--- > > Curious, how easy is that to reproduce? That really shouldn't happen and > its not immediately obvious how it could happen. In particular, mm_take_all_locks() which is called from do_mmu_notifier_register() uses mutex_lock_nest_lock() in both vm_lock_anon_vma() and vm_lock_mapping(), both times using mm->mmap_sem as the nest lock. As per __lock_acquire() any lock that passes in a nest_lock will set hlock->references and also assign this nest_lock to hlock->nest_lock, and as per lock_acquire() all that is done with IRQs disabled, so the interrupt in question should not be able to observe the state where ->references is set, but ->nest_lock is not. So I'm at a loss explaining how match_held_lock() observes exactly that, a lock for which ->references is set, but no ->nest_lock, that should be impossible. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:05 ` Peter Zijlstra 2011-08-04 15:13 ` Peter Zijlstra @ 2011-08-04 15:37 ` Sergey Senozhatsky 2011-08-04 15:47 ` Peter Zijlstra 1 sibling, 1 reply; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-04 15:37 UTC (permalink / raw) To: Peter Zijlstra Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On (08/04/11 17:05), Peter Zijlstra wrote: > On Thu, 2011-08-04 at 17:13 +0300, Sergey Senozhatsky wrote: > > Hello, > > Got the following trace on 3.0-git19 (07865-g1280ea8): > > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > > [ 132.794687] Hardware name: Aspire 5741G > > [ 132.794689] Modules linked in: kvm_intel kvm tun ipv6 microcode snd_hda_codec_hdmi snd_hda_codec_realtek broadcom snd_hda_intel snd_hda_codec tg3 snd_pcm snd_timer snd soundcore acer_wmi evdev libphy sparse_keymap psmouse snd_page_alloc > > pcspkr battery ac wmi button ehci_hcd sr_mod cdrom usbcore sd_mod ahci > > [ 132.794731] Pid: 4029, comm: qemu-system-x86 Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668 > > [ 132.794733] Call Trace: > > [ 132.794736] <IRQ> [<ffffffff8103e4e0>] warn_slowpath_common+0x7e/0x96 > > [ 132.794744] [<ffffffff8103e50d>] warn_slowpath_null+0x15/0x17 > > [ 132.794748] [<ffffffff8106dcee>] match_held_lock+0xf6/0x12e > > [ 132.794751] [<ffffffff8106dd88>] lock_is_held+0x62/0xa6 > > [ 132.794757] [<ffffffff81086471>] cgroup_lock_is_held+0x10/0x12 > > [ 132.794762] [<ffffffff810368a2>] set_task_cpu+0x1ac/0x3e3 > > [ 132.794766] [<ffffffff8103856a>] ? select_task_rq_fair+0x5c0/0x9ca > > [ 132.794769] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > > [ 132.794773] [<ffffffff8103748d>] ? try_to_wake_up+0x29/0x28b > > [ 132.794779] [<ffffffff812552a5>] ? do_raw_spin_lock+0x6b/0x122 > > [ 132.794783] [<ffffffff81037603>] try_to_wake_up+0x19f/0x28b > > [ 132.794787] [<ffffffff810603ed>] ? update_rmtp+0x65/0x65 > > [ 132.794790] [<ffffffff8103770e>] wake_up_process+0x10/0x12 > > [ 132.794794] [<ffffffff8106040a>] hrtimer_wakeup+0x1d/0x21 > > [ 132.794797] [<ffffffff81060816>] __run_hrtimer+0x1b1/0x372 > > [ 132.794800] [<ffffffff810613a2>] hrtimer_interrupt+0xe6/0x1b0 > > [ 132.794805] [<ffffffff810185d5>] smp_apic_timer_interrupt+0x80/0x93 > > [ 132.794810] [<ffffffff81493af3>] apic_timer_interrupt+0x73/0x80 > > [ 132.794812] <EOI> [<ffffffff810fb998>] ? do_mmu_notifier_register+0x66/0x125 > > [ 132.794822] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > > [ 132.794826] [<ffffffff810ec160>] ? mm_take_all_locks+0x139/0x165 > > [ 132.794829] [<ffffffff810ec132>] ? mm_take_all_locks+0x10b/0x165 > > [ 132.794832] [<ffffffff810fb9a0>] do_mmu_notifier_register+0x6e/0x125 > > [ 132.794836] [<ffffffff810fba72>] mmu_notifier_register+0xe/0x10 > > [ 132.794852] [<ffffffffa01fcc0d>] kvm_dev_ioctl+0x297/0x400 [kvm] > > [ 132.794857] [<ffffffff81119022>] do_vfs_ioctl+0x46c/0x4ad > > [ 132.794862] [<ffffffff8110a68d>] ? fget_light+0xed/0x2a7 > > [ 132.794867] [<ffffffff81492fca>] ? sysret_check+0x2e/0x69 > > [ 132.794871] [<ffffffff811190b4>] sys_ioctl+0x51/0x75 > > [ 132.794875] [<ffffffff81492f92>] system_call_fastpath+0x16/0x1b > > [ 132.794877] ---[ end trace 298584c4014cd2b8 ]--- > > Curious, how easy is that to reproduce? That really shouldn't happen and > its not immediately obvious how it could happen. > Hello Peter, Frankly, not very easy. I'm using qemu quite heavy last days and got only one trace so far. Sergey -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:37 ` Sergey Senozhatsky @ 2011-08-04 15:47 ` Peter Zijlstra 2011-08-04 15:53 ` Sergey Senozhatsky 0 siblings, 1 reply; 11+ messages in thread From: Peter Zijlstra @ 2011-08-04 15:47 UTC (permalink / raw) To: Sergey Senozhatsky Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On Thu, 2011-08-04 at 18:37 +0300, Sergey Senozhatsky wrote: > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() Just to double check, that line is: if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) in your kernel source? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:47 ` Peter Zijlstra @ 2011-08-04 15:53 ` Sergey Senozhatsky 2011-08-04 15:57 ` Peter Zijlstra 2011-08-05 12:36 ` Peter Zijlstra 0 siblings, 2 replies; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-04 15:53 UTC (permalink / raw) To: Peter Zijlstra Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On (08/04/11 17:47), Peter Zijlstra wrote: > On Thu, 2011-08-04 at 18:37 +0300, Sergey Senozhatsky wrote: > > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > > Just to double check, that line is: > > if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > > in your kernel source? > Nope, that's `if (DEBUG_LOCKS_WARN_ON(!class))' 3106 static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock) 3107 { 3108 if (hlock->instance == lock) 3109 return 1; 3110 3111 if (hlock->references) { 3112 struct lock_class *class = lock->class_cache[0]; 3113 3114 if (!class) 3115 class = look_up_lock_class(lock, 0); 3116 3117 if (DEBUG_LOCKS_WARN_ON(!class)) 3118 return 0; 3119 3120 if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) 3121 return 0; 3122 3123 if (hlock->class_idx == class - lock_classes + 1) 3124 return 1; 3125 } 3126 3127 return 0; 3128 } 3129 Sergey -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:53 ` Sergey Senozhatsky @ 2011-08-04 15:57 ` Peter Zijlstra 2011-08-04 16:04 ` Sergey Senozhatsky 2011-08-05 12:36 ` Peter Zijlstra 1 sibling, 1 reply; 11+ messages in thread From: Peter Zijlstra @ 2011-08-04 15:57 UTC (permalink / raw) To: Sergey Senozhatsky Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On Thu, 2011-08-04 at 18:53 +0300, Sergey Senozhatsky wrote: > On (08/04/11 17:47), Peter Zijlstra wrote: > > On Thu, 2011-08-04 at 18:37 +0300, Sergey Senozhatsky wrote: > > > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > > > > Just to double check, that line is: > > > > if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > > > > in your kernel source? > > > > Nope, that's `if (DEBUG_LOCKS_WARN_ON(!class))' > > 3106 static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock) > 3107 { > 3108 if (hlock->instance == lock) > 3109 return 1; > 3110 > 3111 if (hlock->references) { > 3112 struct lock_class *class = lock->class_cache[0]; > 3113 > 3114 if (!class) > 3115 class = look_up_lock_class(lock, 0); > 3116 > 3117 if (DEBUG_LOCKS_WARN_ON(!class)) > 3118 return 0; > 3119 > 3120 if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > 3121 return 0; > 3122 > 3123 if (hlock->class_idx == class - lock_classes + 1) > 3124 return 1; > 3125 } > 3126 > 3127 return 0; > 3128 } > 3129 Ah, in that case my previous analysis was pointless and I shall need to scratch my head some more. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:57 ` Peter Zijlstra @ 2011-08-04 16:04 ` Sergey Senozhatsky 0 siblings, 0 replies; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-04 16:04 UTC (permalink / raw) To: Peter Zijlstra Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On (08/04/11 17:57), Peter Zijlstra wrote: > > > > > > [ 132.794685] WARNING: at kernel/lockdep.c:3117 match_held_lock+0xf6/0x12e() > > > > > > Just to double check, that line is: > > > > > > if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > > > > > > in your kernel source? > > > > > > > Nope, that's `if (DEBUG_LOCKS_WARN_ON(!class))' > > > > 3106 static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock) > > 3107 { > > 3108 if (hlock->instance == lock) > > 3109 return 1; > > 3110 > > 3111 if (hlock->references) { > > 3112 struct lock_class *class = lock->class_cache[0]; > > 3113 > > 3114 if (!class) > > 3115 class = look_up_lock_class(lock, 0); > > 3116 > > 3117 if (DEBUG_LOCKS_WARN_ON(!class)) > > 3118 return 0; > > 3119 > > 3120 if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > > 3121 return 0; > > 3122 > > 3123 if (hlock->class_idx == class - lock_classes + 1) > > 3124 return 1; > > 3125 } > > 3126 > > 3127 return 0; > > 3128 } > > 3129 > > Ah, in that case my previous analysis was pointless and I shall need to > scratch my head some more. > That was a good idea to check what's going on on 3117 line. Well, your analysis was correct, it's just we have different match_held_lock() lines, and I guess we may have different lines within match_held_lock()-callers in that case. Just for note, I'm using the latest git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git $ git pull Already up-to-date. Sergey -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-04 15:53 ` Sergey Senozhatsky 2011-08-04 15:57 ` Peter Zijlstra @ 2011-08-05 12:36 ` Peter Zijlstra 2011-08-05 15:27 ` Sergey Senozhatsky 2011-08-06 19:39 ` Sergey Senozhatsky 1 sibling, 2 replies; 11+ messages in thread From: Peter Zijlstra @ 2011-08-05 12:36 UTC (permalink / raw) To: Sergey Senozhatsky Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On Thu, 2011-08-04 at 18:53 +0300, Sergey Senozhatsky wrote: > > Nope, that's `if (DEBUG_LOCKS_WARN_ON(!class))' > The below is what I've come up with. --- Subject: lockdep: Fix wrong assumption in match_held_lock From: Peter Zijlstra <a.p.zijlstra@chello.nl> Date: Fri Aug 05 14:26:17 CEST 2011 match_held_lock() was assuming it was being called on a lock class that had already seen usage. This condition was true for bug-free code using lockdep_assert_held(), since you're in fact holding the lock when calling it. However the assumption fails the moment you assume the assertion can fail, which is the whole point of having the assertion in the first place. Anyway, now that there's more lockdep_is_held() users, notably __rcu_dereference_check(), its much easier to trigger this since we test for a number of locks and we only need to hold any one of them to be good. Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- kernel/lockdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Index: linux-2.6/kernel/lockdep.c =================================================================== --- linux-2.6.orig/kernel/lockdep.c +++ linux-2.6/kernel/lockdep.c @@ -3111,7 +3111,13 @@ static int match_held_lock(struct held_l if (!class) class = look_up_lock_class(lock, 0); - if (DEBUG_LOCKS_WARN_ON(!class)) + /* + * If look_up_lock_class() failed to find a class, we're trying + * to test if we hold a lock that has never yet been acquired. + * Clearly if the lock hasn't been acquired _ever_, we're not + * holding it either, so report failure. + */ + if (!class) return 0; if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-05 12:36 ` Peter Zijlstra @ 2011-08-05 15:27 ` Sergey Senozhatsky 2011-08-06 19:39 ` Sergey Senozhatsky 1 sibling, 0 replies; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-05 15:27 UTC (permalink / raw) To: Peter Zijlstra Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm On (08/05/11 14:36), Peter Zijlstra wrote: > The below is what I've come up with. > Hello, I think that should work. Will test, anyway. Thanks, Sergey > --- > Subject: lockdep: Fix wrong assumption in match_held_lock > From: Peter Zijlstra <a.p.zijlstra@chello.nl> > Date: Fri Aug 05 14:26:17 CEST 2011 > > match_held_lock() was assuming it was being called on a lock class > that had already seen usage. > > This condition was true for bug-free code using lockdep_assert_held(), > since you're in fact holding the lock when calling it. However the > assumption fails the moment you assume the assertion can fail, which > is the whole point of having the assertion in the first place. > > Anyway, now that there's more lockdep_is_held() users, notably > __rcu_dereference_check(), its much easier to trigger this since we > test for a number of locks and we only need to hold any one of them to > be good. > > Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > --- > kernel/lockdep.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > Index: linux-2.6/kernel/lockdep.c > =================================================================== > --- linux-2.6.orig/kernel/lockdep.c > +++ linux-2.6/kernel/lockdep.c > @@ -3111,7 +3111,13 @@ static int match_held_lock(struct held_l > if (!class) > class = look_up_lock_class(lock, 0); > > - if (DEBUG_LOCKS_WARN_ON(!class)) > + /* > + * If look_up_lock_class() failed to find a class, we're trying > + * to test if we hold a lock that has never yet been acquired. > + * Clearly if the lock hasn't been acquired _ever_, we're not > + * holding it either, so report failure. > + */ > + if (!class) > return 0; > > if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock 2011-08-05 12:36 ` Peter Zijlstra 2011-08-05 15:27 ` Sergey Senozhatsky @ 2011-08-06 19:39 ` Sergey Senozhatsky 1 sibling, 0 replies; 11+ messages in thread From: Sergey Senozhatsky @ 2011-08-06 19:39 UTC (permalink / raw) To: Peter Zijlstra Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, linux-kernel, KAMEZAWA Hiroyuki, linux-mm [-- Attachment #1: Type: text/plain, Size: 1987 bytes --] On (08/05/11 14:36), Peter Zijlstra wrote: > The below is what I've come up with. > Hello, Without any problems so far (using qemu quite often these days). Feel free to add my Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Sergey > --- > Subject: lockdep: Fix wrong assumption in match_held_lock > From: Peter Zijlstra <a.p.zijlstra@chello.nl> > Date: Fri Aug 05 14:26:17 CEST 2011 > > match_held_lock() was assuming it was being called on a lock class > that had already seen usage. > > This condition was true for bug-free code using lockdep_assert_held(), > since you're in fact holding the lock when calling it. However the > assumption fails the moment you assume the assertion can fail, which > is the whole point of having the assertion in the first place. > > Anyway, now that there's more lockdep_is_held() users, notably > __rcu_dereference_check(), its much easier to trigger this since we > test for a number of locks and we only need to hold any one of them to > be good. > > Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > --- > kernel/lockdep.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > Index: linux-2.6/kernel/lockdep.c > =================================================================== > --- linux-2.6.orig/kernel/lockdep.c > +++ linux-2.6/kernel/lockdep.c > @@ -3111,7 +3111,13 @@ static int match_held_lock(struct held_l > if (!class) > class = look_up_lock_class(lock, 0); > > - if (DEBUG_LOCKS_WARN_ON(!class)) > + /* > + * If look_up_lock_class() failed to find a class, we're trying > + * to test if we hold a lock that has never yet been acquired. > + * Clearly if the lock hasn't been acquired _ever_, we're not > + * holding it either, so report failure. > + */ > + if (!class) > return 0; > > if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock)) > [-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-08-06 19:40 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-04 14:13 select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock Sergey Senozhatsky 2011-08-04 15:05 ` Peter Zijlstra 2011-08-04 15:13 ` Peter Zijlstra 2011-08-04 15:37 ` Sergey Senozhatsky 2011-08-04 15:47 ` Peter Zijlstra 2011-08-04 15:53 ` Sergey Senozhatsky 2011-08-04 15:57 ` Peter Zijlstra 2011-08-04 16:04 ` Sergey Senozhatsky 2011-08-05 12:36 ` Peter Zijlstra 2011-08-05 15:27 ` Sergey Senozhatsky 2011-08-06 19:39 ` Sergey Senozhatsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).