Peter Zijlstra e32e58a96d x86: fix lockdep warning during suspend-to-ram
Andrew Morton wrote:

> I've been seeing the below for a long time during suspend-to-ram on the Vaio.
>
>
> PM: Syncing filesystems ... done.
> PM: Preparing system for mem sleep
> Freezing user space processes ... <4>------------[ cut here ]------------
> WARNING: at kernel/lockdep.c:2658 check_flags+0x4c/0x127()
> Modules linked in: i915 drm ipw2200 sonypi ipv6 autofs4 hidp l2cap bluetooth sunrpc nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4 xt_state nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables acpi_cpufreq nvram ohci1394 ieee1394 ehci_hcd uhci_hcd sg joydev snd_hda_intel snd_seq_dummy sr_mod snd_seq_oss cdrom snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ieee80211 pcspkr ieee80211_crypt snd_pcm i2c_i801 snd_timer i2c_core ide_pci_generic piix snd soundcore snd_page_alloc button ext3 jbd ide_disk ide_core [last unloaded: ipw2200]
> Pid: 3250, comm: zsh Not tainted 2.6.26-rc5 #1
>  [<c011c5f5>] warn_on_slowpath+0x41/0x6d
>  [<c01080e6>] ? native_sched_clock+0x82/0x96
>  [<c013789c>] ? mark_held_locks+0x41/0x5c
>  [<c0315688>] ? _spin_unlock_irqrestore+0x36/0x58
>  [<c0137a29>] ? trace_hardirqs_on+0xe6/0x10d
>  [<c0138637>] ? __lock_acquire+0xae3/0xb2b
>  [<c0313413>] ? schedule+0x39b/0x3b4
>  [<c0135596>] check_flags+0x4c/0x127
>  [<c01386b9>] lock_acquire+0x3a/0x86
>  [<c0315075>] _spin_lock+0x26/0x53
>  [<c0140660>] ? refrigerator+0x13/0xc3
>  [<c0140660>] refrigerator+0x13/0xc3
>  [<c012684a>] get_signal_to_deliver+0x3c/0x31e
>  [<c0102fe7>] do_notify_resume+0x91/0x6ee
>  [<c01359fd>] ? lock_release_holdtime+0x50/0x56
>  [<c0315688>] ? _spin_unlock_irqrestore+0x36/0x58
>  [<c0235d24>] ? read_chan+0x0/0x58c
>  [<c0137a29>] ? trace_hardirqs_on+0xe6/0x10d
>  [<c0315694>] ? _spin_unlock_irqrestore+0x42/0x58
>  [<c0230afa>] ? tty_ldisc_deref+0x5c/0x63
>  [<c0233104>] ? tty_read+0x66/0x98
>  [<c014b3f0>] ? audit_syscall_exit+0x2aa/0x2c5
>  [<c0109430>] ? do_syscall_trace+0x6b/0x16f
>  [<c0103a9c>] work_notifysig+0x13/0x1b
>  =======================
> ---[ end trace 25b49fe59a25afa5 ]---
> possible reason: unannotated irqs-off.
> irq event stamp: 58919
> hardirqs last  enabled at (58919): [<c0103afd>] syscall_exit_work+0x11/0x26

Joy - I so love entry.S

Best I can make of it:

syscall_exit_work
  resume_userspace
    DISABLE_INTERRUPTS
    (no TRACE_IRQS_OFF)
      work_pending
        work_notifysig
          do_notify_resume()
            do_signal()
              get_signal_to_deliver()
                try_to_freeze()
                  refrigerator()
                    task_lock() -> check_flags() -> BANG

The normal path is:

syscall_exit_work
  resume_userspace
    DISABLE_INTERRUPTS
    restore_all
      TRACE_IRQS_IRET
      iret

No idea why that would not warn..

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-06-12 21:27:09 +02:00
..
2008-06-04 13:11:46 +02:00
2007-10-17 21:19:04 +02:00
2008-04-25 19:54:07 +02:00
2008-04-17 17:41:19 +02:00
2008-04-26 17:35:47 +02:00
2008-04-29 08:06:29 -07:00
2008-04-29 08:06:29 -07:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2008-04-19 19:10:28 -07:00
2007-10-19 11:53:33 -07:00
2007-10-13 10:01:23 -07:00
2008-01-30 13:31:31 +01:00
2008-04-29 13:45:24 +02:00
2008-02-19 16:18:28 +01:00
2008-04-19 19:19:54 +02:00
2007-10-11 11:17:01 +02:00
2008-01-30 13:31:19 +01:00
2008-04-19 19:19:54 +02:00
2008-04-17 17:41:13 +02:00
2008-04-30 23:15:34 +02:00
2008-04-17 17:41:36 +02:00
2008-04-19 19:19:58 +02:00
2008-04-17 17:40:49 +02:00
2008-06-12 21:26:12 +02:00
2008-04-17 17:41:37 +02:00
2008-04-30 23:15:34 +02:00
2008-04-26 17:35:47 +02:00
2008-04-26 17:35:48 +02:00
2008-03-26 22:23:40 +01:00
2008-01-30 13:33:10 +01:00
2008-04-17 17:40:56 +02:00
2008-04-29 08:06:02 -07:00
2007-10-11 11:17:24 +02:00
2008-04-19 19:19:54 +02:00
2008-04-27 12:00:28 +03:00
2008-05-23 14:08:06 +02:00
2008-05-07 12:42:03 +02:00
2008-06-12 21:25:51 +02:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2008-05-04 20:04:45 +02:00
2008-04-19 19:10:28 -07:00
2008-06-12 21:26:28 +02:00
2008-01-30 13:33:19 +01:00
2008-05-12 21:27:50 +02:00
2008-04-19 19:19:57 +02:00
2008-04-19 19:19:56 +02:00
2007-10-11 11:17:01 +02:00
2008-04-19 19:19:55 +02:00
2008-04-30 08:29:37 -07:00
2008-04-30 08:29:37 -07:00
2008-05-13 19:36:12 +02:00
2008-04-17 17:40:55 +02:00
2008-04-17 17:40:55 +02:00
2008-04-26 17:35:47 +02:00
2008-04-29 08:06:03 -07:00
2008-02-08 09:22:29 -08:00
2008-04-17 17:40:56 +02:00
2008-01-30 13:31:52 +01:00
2008-04-17 17:41:37 +02:00
2008-05-23 14:08:06 +02:00
2007-10-11 11:17:24 +02:00
2008-04-24 23:57:31 +02:00
2008-04-28 13:49:35 -07:00
2007-10-11 11:17:01 +02:00
2008-04-24 23:15:44 +02:00