* 2 bugs related to suspend to disk
@ 2009-05-24 19:05 Marcin Slusarz
2009-05-24 19:58 ` Rafael J. Wysocki
2009-05-24 20:54 ` Pavel Machek
0 siblings, 2 replies; 12+ messages in thread
From: Marcin Slusarz @ 2009-05-24 19:05 UTC (permalink / raw)
To: LKML; +Cc: Pavel Machek, Rafael J. Wysocki, Linux PM List
1) echo platform > /sys/power/disk; echo disk > /sys/power/state
works but prints:
BUG: sleeping function called from invalid context at include/linux/writeback.h:87
in_atomic(): 1, irqs_disabled(): 0, pid: 6509, name: sh
3 locks held by sh/6509:
#0: (&buffer->mutex){+.+.+.}, at: [<>] sysfs_write_file+0x38/0x119
#1: (pm_mutex){+.+.+.}, at: [<>] hibernate+0x17/0x169
#2: (swap_lock){+.+...}, at: [<>] swap_type_of+0x2e/0xed
Pid: 6509, comm: sh Not tainted 2.6.30-rc7-mod #124
Call Trace:
? __debug_show_held_locks
? bdev_test
__might_sleep
ifind
? bdev_test
iget5_locked
? bdev_set
bdget
swap_type_of
swsusp_write
? acpi_sleep_tts_switch
hibernate
state_store
kobj_attr_store
sysfs_write_file
vfs_write
sys_write
system_call_fastpath
2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
It's not a regression, because I never tried to STD (STR worked).
Marcin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-24 19:05 2 bugs related to suspend to disk Marcin Slusarz
@ 2009-05-24 19:58 ` Rafael J. Wysocki
2009-05-25 14:56 ` [linux-pm] " Sebastian Ott
2009-05-24 20:54 ` Pavel Machek
1 sibling, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-05-24 19:58 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: LKML, Pavel Machek, Linux PM List
On Sunday 24 May 2009, Marcin Slusarz wrote:
> 1) echo platform > /sys/power/disk; echo disk > /sys/power/state
>
> works but prints:
>
> BUG: sleeping function called from invalid context at include/linux/writeback.h:87
> in_atomic(): 1, irqs_disabled(): 0, pid: 6509, name: sh
> 3 locks held by sh/6509:
> #0: (&buffer->mutex){+.+.+.}, at: [<>] sysfs_write_file+0x38/0x119
> #1: (pm_mutex){+.+.+.}, at: [<>] hibernate+0x17/0x169
> #2: (swap_lock){+.+...}, at: [<>] swap_type_of+0x2e/0xed
> Pid: 6509, comm: sh Not tainted 2.6.30-rc7-mod #124
> Call Trace:
> ? __debug_show_held_locks
> ? bdev_test
> __might_sleep
> ifind
> ? bdev_test
> iget5_locked
> ? bdev_set
> bdget
> swap_type_of
> swsusp_write
> ? acpi_sleep_tts_switch
> hibernate
> state_store
> kobj_attr_store
> sysfs_write_file
> vfs_write
> sys_write
> system_call_fastpath
>
> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>
> It's not a regression, because I never tried to STD (STR worked).
Both look strange, at least the first one does.
Thanks for the report, I'll do my best to take care of this as soon as I can.
Best,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-24 19:05 2 bugs related to suspend to disk Marcin Slusarz
2009-05-24 19:58 ` Rafael J. Wysocki
@ 2009-05-24 20:54 ` Pavel Machek
2009-05-24 21:56 ` Marcin Slusarz
1 sibling, 1 reply; 12+ messages in thread
From: Pavel Machek @ 2009-05-24 20:54 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: LKML, Rafael J. Wysocki, Linux PM List
Hi!
> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>
I'm afraid we need more details here. Is "resume" binary being ran?
Does it produce some output?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-24 20:54 ` Pavel Machek
@ 2009-05-24 21:56 ` Marcin Slusarz
2009-05-24 22:04 ` Rafael J. Wysocki
0 siblings, 1 reply; 12+ messages in thread
From: Marcin Slusarz @ 2009-05-24 21:56 UTC (permalink / raw)
To: Pavel Machek; +Cc: LKML, Rafael J. Wysocki, Linux PM List
Pavel Machek wrote:
> Hi!
>
>
>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>>
>
> I'm afraid we need more details here. Is "resume" binary being ran?
Excellent question ;) - I didn't know it has to. I'll try to setup
initramfs tomorrow.
Thanks and sorry for the noise!
Marcin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-24 21:56 ` Marcin Slusarz
@ 2009-05-24 22:04 ` Rafael J. Wysocki
2009-05-25 17:22 ` Marcin Slusarz
0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-05-24 22:04 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: Pavel Machek, LKML, Linux PM List
On Sunday 24 May 2009, Marcin Slusarz wrote:
> Pavel Machek wrote:
> > Hi!
> >
> >
> >> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
> >>
> >
> > I'm afraid we need more details here. Is "resume" binary being ran?
>
> Excellent question ;) - I didn't know it has to. I'll try to setup
> initramfs tomorrow.
>
> Thanks and sorry for the noise!
However, the issue reported as 1) is not really a noise IMO. :-)
Can you please attach a full dmesg output containing these messages?
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [linux-pm] 2 bugs related to suspend to disk
2009-05-24 19:58 ` Rafael J. Wysocki
@ 2009-05-25 14:56 ` Sebastian Ott
2009-05-25 21:29 ` Rafael J. Wysocki
0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Ott @ 2009-05-25 14:56 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Marcin Slusarz, Linux PM List, LKML
hi,
On Sun, 24 May 2009, Rafael J. Wysocki wrote:
> On Sunday 24 May 2009, Marcin Slusarz wrote:
> > 1) echo platform > /sys/power/disk; echo disk > /sys/power/state
> >
> > works but prints:
> >
> > BUG: sleeping function called from invalid context at include/linux/writeback.h:87
> > in_atomic(): 1, irqs_disabled(): 0, pid: 6509, name: sh
> > 3 locks held by sh/6509:
> > #0: (&buffer->mutex){+.+.+.}, at: [<>] sysfs_write_file+0x38/0x119
> > #1: (pm_mutex){+.+.+.}, at: [<>] hibernate+0x17/0x169
> > #2: (swap_lock){+.+...}, at: [<>] swap_type_of+0x2e/0xed
> > Pid: 6509, comm: sh Not tainted 2.6.30-rc7-mod #124
> > Call Trace:
> > ? __debug_show_held_locks
> > ? bdev_test
> > __might_sleep
> > ifind
> > ? bdev_test
> > iget5_locked
> > ? bdev_set
> > bdget
> > swap_type_of
> > swsusp_write
> > ? acpi_sleep_tts_switch
> > hibernate
> > state_store
> > kobj_attr_store
> > sysfs_write_file
> > vfs_write
> > sys_write
> > system_call_fastpath
> >
> > 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
> >
> > It's not a regression, because I never tried to STD (STR worked).
>
> Both look strange, at least the first one does.
>
> Thanks for the report, I'll do my best to take care of this as soon as I can.
>
i've seen a similar warning, the problem seems to be that swap_type_of
calls bdget with the swap_lock held.
with the attached patch i don't see this warning any more - but i'm not
sure if this is the correct way to fix this
regards, sebastian
---
don't call bdget with swap_lock held
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
mm/swapfile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.5/mm/swapfile.c
===================================================================
--- linux-2.5.orig/mm/swapfile.c 2009-03-24 13:51:00.000000000 +0100
+++ linux-2.5/mm/swapfile.c 2009-05-25 15:33:34.000000000 +0200
@@ -634,10 +634,10 @@ int swap_type_of(dev_t device, sector_t
continue;
if (!bdev) {
+ spin_unlock(&swap_lock);
if (bdev_p)
*bdev_p = bdget(sis->bdev->bd_dev);
- spin_unlock(&swap_lock);
return i;
}
if (bdev == sis->bdev) {
@@ -646,10 +646,10 @@ int swap_type_of(dev_t device, sector_t
se = list_entry(sis->extent_list.next,
struct swap_extent, list);
if (se->start_block == offset) {
+ spin_unlock(&swap_lock);
if (bdev_p)
*bdev_p = bdget(sis->bdev->bd_dev);
- spin_unlock(&swap_lock);
bdput(bdev);
return i;
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-24 22:04 ` Rafael J. Wysocki
@ 2009-05-25 17:22 ` Marcin Slusarz
2009-05-25 21:31 ` Rafael J. Wysocki
0 siblings, 1 reply; 12+ messages in thread
From: Marcin Slusarz @ 2009-05-25 17:22 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Pavel Machek, LKML, Linux PM List
Rafael J. Wysocki wrote:
> On Sunday 24 May 2009, Marcin Slusarz wrote:
>> Pavel Machek wrote:
>>> Hi!
>>>
>>>
>>>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>>>>
>>> I'm afraid we need more details here. Is "resume" binary being ran?
>> Excellent question ;) - I didn't know it has to. I'll try to setup
>> initramfs tomorrow.
>>
>> Thanks and sorry for the noise!
>
> However, the issue reported as 1) is not really a noise IMO. :-)
>
> Can you please attach a full dmesg output containing these messages?
I've uploaded .config, dmesg (BUG was not saved) and 2 pictures of
screen just before power loss to http://www.kadu.net/~joi/kernel/2009.05.25/
(Please ignore first suspend failure (3681.078646 - 3685.514358) - I forgot
to restore swap)
Marcin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [linux-pm] 2 bugs related to suspend to disk
2009-05-25 14:56 ` [linux-pm] " Sebastian Ott
@ 2009-05-25 21:29 ` Rafael J. Wysocki
0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-05-25 21:29 UTC (permalink / raw)
To: Sebastian Ott; +Cc: Marcin Slusarz, Linux PM List, LKML
On Monday 25 May 2009, Sebastian Ott wrote:
> hi,
>
> On Sun, 24 May 2009, Rafael J. Wysocki wrote:
>
> > On Sunday 24 May 2009, Marcin Slusarz wrote:
> > > 1) echo platform > /sys/power/disk; echo disk > /sys/power/state
> > >
> > > works but prints:
> > >
> > > BUG: sleeping function called from invalid context at include/linux/writeback.h:87
> > > in_atomic(): 1, irqs_disabled(): 0, pid: 6509, name: sh
> > > 3 locks held by sh/6509:
> > > #0: (&buffer->mutex){+.+.+.}, at: [<>] sysfs_write_file+0x38/0x119
> > > #1: (pm_mutex){+.+.+.}, at: [<>] hibernate+0x17/0x169
> > > #2: (swap_lock){+.+...}, at: [<>] swap_type_of+0x2e/0xed
> > > Pid: 6509, comm: sh Not tainted 2.6.30-rc7-mod #124
> > > Call Trace:
> > > ? __debug_show_held_locks
> > > ? bdev_test
> > > __might_sleep
> > > ifind
> > > ? bdev_test
> > > iget5_locked
> > > ? bdev_set
> > > bdget
> > > swap_type_of
> > > swsusp_write
> > > ? acpi_sleep_tts_switch
> > > hibernate
> > > state_store
> > > kobj_attr_store
> > > sysfs_write_file
> > > vfs_write
> > > sys_write
> > > system_call_fastpath
> > >
> > > 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
> > >
> > > It's not a regression, because I never tried to STD (STR worked).
> >
> > Both look strange, at least the first one does.
> >
> > Thanks for the report, I'll do my best to take care of this as soon as I can.
> >
>
> i've seen a similar warning, the problem seems to be that swap_type_of
> calls bdget with the swap_lock held.
Well, it didn't cause any problems in the past.
> with the attached patch i don't see this warning any more - but i'm not
> sure if this is the correct way to fix this
I'll have a look, thanks for the patch.
> regards, sebastian
> ---
>
> don't call bdget with swap_lock held
>
> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
> ---
> mm/swapfile.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.5/mm/swapfile.c
> ===================================================================
> --- linux-2.5.orig/mm/swapfile.c 2009-03-24 13:51:00.000000000 +0100
> +++ linux-2.5/mm/swapfile.c 2009-05-25 15:33:34.000000000 +0200
> @@ -634,10 +634,10 @@ int swap_type_of(dev_t device, sector_t
> continue;
>
> if (!bdev) {
> + spin_unlock(&swap_lock);
> if (bdev_p)
> *bdev_p = bdget(sis->bdev->bd_dev);
>
> - spin_unlock(&swap_lock);
> return i;
> }
> if (bdev == sis->bdev) {
> @@ -646,10 +646,10 @@ int swap_type_of(dev_t device, sector_t
> se = list_entry(sis->extent_list.next,
> struct swap_extent, list);
> if (se->start_block == offset) {
> + spin_unlock(&swap_lock);
> if (bdev_p)
> *bdev_p = bdget(sis->bdev->bd_dev);
>
> - spin_unlock(&swap_lock);
> bdput(bdev);
> return i;
> }
> --
Best,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-25 17:22 ` Marcin Slusarz
@ 2009-05-25 21:31 ` Rafael J. Wysocki
2009-05-27 19:53 ` Marcin Slusarz
0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-05-25 21:31 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: Pavel Machek, LKML, Linux PM List
On Monday 25 May 2009, Marcin Slusarz wrote:
> Rafael J. Wysocki wrote:
> > On Sunday 24 May 2009, Marcin Slusarz wrote:
> >> Pavel Machek wrote:
> >>> Hi!
> >>>
> >>>
> >>>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
> >>>>
> >>> I'm afraid we need more details here. Is "resume" binary being ran?
> >> Excellent question ;) - I didn't know it has to. I'll try to setup
> >> initramfs tomorrow.
> >>
> >> Thanks and sorry for the noise!
> >
> > However, the issue reported as 1) is not really a noise IMO. :-)
> >
> > Can you please attach a full dmesg output containing these messages?
>
> I've uploaded .config, dmesg (BUG was not saved) and 2 pictures of
> screen just before power loss to http://www.kadu.net/~joi/kernel/2009.05.25/
> (Please ignore first suspend failure (3681.078646 - 3685.514358) - I forgot
> to restore swap)
Thanks.
Can you please test the patch sent by Sebastian Ott in this thread?
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-25 21:31 ` Rafael J. Wysocki
@ 2009-05-27 19:53 ` Marcin Slusarz
2009-05-27 20:47 ` Rafael J. Wysocki
0 siblings, 1 reply; 12+ messages in thread
From: Marcin Slusarz @ 2009-05-27 19:53 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Pavel Machek, LKML, Linux PM List
Rafael J. Wysocki wrote
> On Monday 25 May 2009, Marcin Slusarz wrote:
>> Rafael J. Wysocki wrote:
>>> On Sunday 24 May 2009, Marcin Slusarz wrote:
>>>> Pavel Machek wrote:
>>>>> Hi!
>>>>>
>>>>>
>>>>>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>>>>>>
>>>>> I'm afraid we need more details here. Is "resume" binary being ran?
>>>> Excellent question ;) - I didn't know it has to. I'll try to setup
>>>> initramfs tomorrow.
>>>>
>>>> Thanks and sorry for the noise!
>>> However, the issue reported as 1) is not really a noise IMO. :-)
>>>
>>> Can you please attach a full dmesg output containing these messages?
>> I've uploaded .config, dmesg (BUG was not saved) and 2 pictures of
>> screen just before power loss to http://www.kadu.net/~joi/kernel/2009.05.25/
>> (Please ignore first suspend failure (3681.078646 - 3685.514358) - I forgot
>> to restore swap)
>
> Thanks.
>
> Can you please test the patch sent by Sebastian Ott in this thread?
BUG disappeared with this patch. Is this a final fix?
Marcin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-27 19:53 ` Marcin Slusarz
@ 2009-05-27 20:47 ` Rafael J. Wysocki
2009-07-11 14:38 ` Marcin Slusarz
0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2009-05-27 20:47 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: Pavel Machek, LKML, Linux PM List
On Wednesday 27 May 2009, Marcin Slusarz wrote:
> Rafael J. Wysocki wrote
> > On Monday 25 May 2009, Marcin Slusarz wrote:
> >> Rafael J. Wysocki wrote:
> >>> On Sunday 24 May 2009, Marcin Slusarz wrote:
> >>>> Pavel Machek wrote:
> >>>>> Hi!
> >>>>>
> >>>>>
> >>>>>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
> >>>>>>
> >>>>> I'm afraid we need more details here. Is "resume" binary being ran?
> >>>> Excellent question ;) - I didn't know it has to. I'll try to setup
> >>>> initramfs tomorrow.
> >>>>
> >>>> Thanks and sorry for the noise!
> >>> However, the issue reported as 1) is not really a noise IMO. :-)
> >>>
> >>> Can you please attach a full dmesg output containing these messages?
> >> I've uploaded .config, dmesg (BUG was not saved) and 2 pictures of
> >> screen just before power loss to http://www.kadu.net/~joi/kernel/2009.05.25/
> >> (Please ignore first suspend failure (3681.078646 - 3685.514358) - I forgot
> >> to restore swap)
> >
> > Thanks.
> >
> > Can you please test the patch sent by Sebastian Ott in this thread?
>
> BUG disappeared with this patch.
Thanks for testing.
> Is this a final fix?
I'm not sure yet.
Best,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: 2 bugs related to suspend to disk
2009-05-27 20:47 ` Rafael J. Wysocki
@ 2009-07-11 14:38 ` Marcin Slusarz
0 siblings, 0 replies; 12+ messages in thread
From: Marcin Slusarz @ 2009-07-11 14:38 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Pavel Machek, LKML, Linux PM List
Rafael J. Wysocki pisze:
> On Wednesday 27 May 2009, Marcin Slusarz wrote:
>> Rafael J. Wysocki wrote
>>> On Monday 25 May 2009, Marcin Slusarz wrote:
>>>> Rafael J. Wysocki wrote:
>>>>> On Sunday 24 May 2009, Marcin Slusarz wrote:
>>>>>> Pavel Machek wrote:
>>>>>>> Hi!
>>>>>>>
>>>>>>>
>>>>>>>> 2) "s2disk" (from suspend-0.8) suspends, but doesn't resume (and I need to mkswap && swapon -a later)
>>>>>>>>
>>>>>>> I'm afraid we need more details here. Is "resume" binary being ran?
>>>>>> Excellent question ;) - I didn't know it has to. I'll try to setup
>>>>>> initramfs tomorrow.
>>>>>>
>>>>>> Thanks and sorry for the noise!
>>>>> However, the issue reported as 1) is not really a noise IMO. :-)
>>>>>
>>>>> Can you please attach a full dmesg output containing these messages?
>>>> I've uploaded .config, dmesg (BUG was not saved) and 2 pictures of
>>>> screen just before power loss to http://www.kadu.net/~joi/kernel/2009.05.25/
>>>> (Please ignore first suspend failure (3681.078646 - 3685.514358) - I forgot
>>>> to restore swap)
>>> Thanks.
>>>
>>> Can you please test the patch sent by Sebastian Ott in this thread?
>> BUG disappeared with this patch.
>
> Thanks for testing.
>
>> Is this a final fix?
>
> I'm not sure yet.
This bug (first) is still with us as of 2.6.31-rc2-faf80d62e44dc627efb741f48db50c1858d1667c
Marcin
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-07-11 14:38 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-24 19:05 2 bugs related to suspend to disk Marcin Slusarz
2009-05-24 19:58 ` Rafael J. Wysocki
2009-05-25 14:56 ` [linux-pm] " Sebastian Ott
2009-05-25 21:29 ` Rafael J. Wysocki
2009-05-24 20:54 ` Pavel Machek
2009-05-24 21:56 ` Marcin Slusarz
2009-05-24 22:04 ` Rafael J. Wysocki
2009-05-25 17:22 ` Marcin Slusarz
2009-05-25 21:31 ` Rafael J. Wysocki
2009-05-27 19:53 ` Marcin Slusarz
2009-05-27 20:47 ` Rafael J. Wysocki
2009-07-11 14:38 ` Marcin Slusarz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox