Marc MERLIN | 27 Feb 20:06 2014

3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

This does not happen consistently, but sometimes:

PM: Preparing system for mem sleep
Freezing user space processes ... 
(...)
 Freezing of tasks failed after 20.002 seconds (1 tasks refusing to freeze, wq_busy=0):
 btrfs           D ffff88017639c800     0 12239  12224 0x00000084
  ffff880165ec1960 0000000000000086 ffff880165ec1fd8 ffff88017639c2d0
  00000000000141c0 ffff88017639c2d0 ffff88007b874000 ffff8804062fa480
  0000000000000000 ffff880175837ec0 ffff88007b874220 ffff880165ec1970
 Call Trace:
  [<ffffffff8160b0d9>] schedule+0x73/0x75
  [<ffffffff8126e94c>] scrub_pages+0x27e/0x426
  [<ffffffff81085062>] ? finish_wait+0x65/0x65
  [<ffffffff81271732>] scrub_stripe+0xada/0xc9e
  [<ffffffff812719cc>] scrub_chunk.isra.9+0xd6/0x10d
  [<ffffffff81271c77>] scrub_enumerate_chunks+0x274/0x418
  [<ffffffff81085000>] ? finish_wait+0x3/0x65
  [<ffffffff812723bb>] btrfs_scrub_dev+0x254/0x3cb
  [<ffffffff8116ddab>] ? __mnt_want_write+0x62/0x78
  [<ffffffff81255c68>] btrfs_ioctl+0x1114/0x24b1
  [<ffffffff81140698>] ? ____cache_alloc+0x1c/0x29b
  [<ffffffff81140a06>] ? kmem_cache_alloc_node+0xef/0x179
  [<ffffffff8160d7b3>] ? _raw_spin_unlock+0x17/0x2a
  [<ffffffff81163ade>] do_vfs_ioctl+0x3d2/0x41d
  [<ffffffff8116bd00>] ? __fget+0x6f/0x79
  [<ffffffff81163b80>] SyS_ioctl+0x57/0x82
  [<ffffffff8161426d>] system_call_fastpath+0x1a/0x1f

And then I end up with a hot laptop and a mostly dead battery in my backpack.
(Continue reading)

Marc MERLIN | 28 Feb 00:30 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

On Thu, Feb 27, 2014 at 11:06:56AM -0800, Marc MERLIN wrote:
> This does not happen consistently, but sometimes:
> 
> PM: Preparing system for mem sleep
> Freezing user space processes ... 
> (...)
>  Freezing of tasks failed after 20.002 seconds (1 tasks refusing to freeze, wq_busy=0):
>  btrfs           D ffff88017639c800     0 12239  12224 0x00000084
>   ffff880165ec1960 0000000000000086 ffff880165ec1fd8 ffff88017639c2d0
>   00000000000141c0 ffff88017639c2d0 ffff88007b874000 ffff8804062fa480
>   0000000000000000 ffff880175837ec0 ffff88007b874220 ffff880165ec1970
>  Call Trace:
>   [<ffffffff8160b0d9>] schedule+0x73/0x75
>   [<ffffffff8126e94c>] scrub_pages+0x27e/0x426
>   [<ffffffff81085062>] ? finish_wait+0x65/0x65
>   [<ffffffff81271732>] scrub_stripe+0xada/0xc9e
>   [<ffffffff812719cc>] scrub_chunk.isra.9+0xd6/0x10d
>   [<ffffffff81271c77>] scrub_enumerate_chunks+0x274/0x418
>   [<ffffffff81085000>] ? finish_wait+0x3/0x65
>   [<ffffffff812723bb>] btrfs_scrub_dev+0x254/0x3cb
>   [<ffffffff8116ddab>] ? __mnt_want_write+0x62/0x78
>   [<ffffffff81255c68>] btrfs_ioctl+0x1114/0x24b1
>   [<ffffffff81140698>] ? ____cache_alloc+0x1c/0x29b
>   [<ffffffff81140a06>] ? kmem_cache_alloc_node+0xef/0x179
>   [<ffffffff8160d7b3>] ? _raw_spin_unlock+0x17/0x2a
>   [<ffffffff81163ade>] do_vfs_ioctl+0x3d2/0x41d
>   [<ffffffff8116bd00>] ? __fget+0x6f/0x79
>   [<ffffffff81163b80>] SyS_ioctl+0x57/0x82
>   [<ffffffff8161426d>] system_call_fastpath+0x1a/0x1f

(Continue reading)

Wang Shilong | 28 Feb 02:18 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

Hi Marc,

On 02/28/2014 03:06 AM, Marc MERLIN wrote:
> This does not happen consistently, but sometimes:
>
> PM: Preparing system for mem sleep
> Freezing user space processes ...
> (...)
>   Freezing of tasks failed after 20.002 seconds (1 tasks refusing to freeze, wq_busy=0):
>   btrfs           D ffff88017639c800     0 12239  12224 0x00000084
>    ffff880165ec1960 0000000000000086 ffff880165ec1fd8 ffff88017639c2d0
>    00000000000141c0 ffff88017639c2d0 ffff88007b874000 ffff8804062fa480
>    0000000000000000 ffff880175837ec0 ffff88007b874220 ffff880165ec1970
>   Call Trace:
>    [<ffffffff8160b0d9>] schedule+0x73/0x75
>    [<ffffffff8126e94c>] scrub_pages+0x27e/0x426
>    [<ffffffff81085062>] ? finish_wait+0x65/0x65
>    [<ffffffff81271732>] scrub_stripe+0xada/0xc9e
>    [<ffffffff812719cc>] scrub_chunk.isra.9+0xd6/0x10d
>    [<ffffffff81271c77>] scrub_enumerate_chunks+0x274/0x418
>    [<ffffffff81085000>] ? finish_wait+0x3/0x65
>    [<ffffffff812723bb>] btrfs_scrub_dev+0x254/0x3cb
>    [<ffffffff8116ddab>] ? __mnt_want_write+0x62/0x78
>    [<ffffffff81255c68>] btrfs_ioctl+0x1114/0x24b1
>    [<ffffffff81140698>] ? ____cache_alloc+0x1c/0x29b
>    [<ffffffff81140a06>] ? kmem_cache_alloc_node+0xef/0x179
>    [<ffffffff8160d7b3>] ? _raw_spin_unlock+0x17/0x2a
>    [<ffffffff81163ade>] do_vfs_ioctl+0x3d2/0x41d
>    [<ffffffff8116bd00>] ? __fget+0x6f/0x79
>    [<ffffffff81163b80>] SyS_ioctl+0x57/0x82
(Continue reading)

Josef Bacik | 3 Mar 17:56 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep


On 02/27/2014 02:06 PM, Marc MERLIN wrote:
> This does not happen consistently, but sometimes:
> 
> PM: Preparing system for mem sleep Freezing user space processes
> ... (...) Freezing of tasks failed after 20.002 seconds (1 tasks
> refusing to freeze, wq_busy=0): btrfs           D ffff88017639c800
> 0 12239  12224 0x00000084 ffff880165ec1960 0000000000000086
> ffff880165ec1fd8 ffff88017639c2d0 00000000000141c0 ffff88017639c2d0
> ffff88007b874000 ffff8804062fa480 0000000000000000 ffff880175837ec0
> ffff88007b874220 ffff880165ec1970 Call Trace: [<ffffffff8160b0d9>]
> schedule+0x73/0x75 [<ffffffff8126e94c>] scrub_pages+0x27e/0x426 
> [<ffffffff81085062>] ? finish_wait+0x65/0x65 [<ffffffff81271732>]
> scrub_stripe+0xada/0xc9e [<ffffffff812719cc>]
> scrub_chunk.isra.9+0xd6/0x10d [<ffffffff81271c77>]
> scrub_enumerate_chunks+0x274/0x418 [<ffffffff81085000>] ?
> finish_wait+0x3/0x65 [<ffffffff812723bb>]
> btrfs_scrub_dev+0x254/0x3cb [<ffffffff8116ddab>] ?
> __mnt_want_write+0x62/0x78 [<ffffffff81255c68>]
> btrfs_ioctl+0x1114/0x24b1 [<ffffffff81140698>] ?
> ____cache_alloc+0x1c/0x29b [<ffffffff81140a06>] ?
> kmem_cache_alloc_node+0xef/0x179 [<ffffffff8160d7b3>] ?
> _raw_spin_unlock+0x17/0x2a [<ffffffff81163ade>]
> do_vfs_ioctl+0x3d2/0x41d [<ffffffff8116bd00>] ? __fget+0x6f/0x79 
> [<ffffffff81163b80>] SyS_ioctl+0x57/0x82 [<ffffffff8161426d>]
> system_call_fastpath+0x1a/0x1f
> 
> 
> And then I end up with a hot laptop and a mostly dead battery in my
> backpack.
(Continue reading)

Josef Bacik | 3 Mar 18:09 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep


On 03/03/2014 11:56 AM, Josef Bacik wrote:
> On 02/27/2014 02:06 PM, Marc MERLIN wrote:
>> This does not happen consistently, but sometimes:
> 
>> PM: Preparing system for mem sleep Freezing user space processes 
>> ... (...) Freezing of tasks failed after 20.002 seconds (1 tasks 
>> refusing to freeze, wq_busy=0): btrfs           D
>> ffff88017639c800 0 12239  12224 0x00000084 ffff880165ec1960
>> 0000000000000086 ffff880165ec1fd8 ffff88017639c2d0
>> 00000000000141c0 ffff88017639c2d0 ffff88007b874000
>> ffff8804062fa480 0000000000000000 ffff880175837ec0 
>> ffff88007b874220 ffff880165ec1970 Call Trace:
>> [<ffffffff8160b0d9>] schedule+0x73/0x75 [<ffffffff8126e94c>]
>> scrub_pages+0x27e/0x426 [<ffffffff81085062>] ?
>> finish_wait+0x65/0x65 [<ffffffff81271732>] 
>> scrub_stripe+0xada/0xc9e [<ffffffff812719cc>] 
>> scrub_chunk.isra.9+0xd6/0x10d [<ffffffff81271c77>] 
>> scrub_enumerate_chunks+0x274/0x418 [<ffffffff81085000>] ? 
>> finish_wait+0x3/0x65 [<ffffffff812723bb>] 
>> btrfs_scrub_dev+0x254/0x3cb [<ffffffff8116ddab>] ? 
>> __mnt_want_write+0x62/0x78 [<ffffffff81255c68>] 
>> btrfs_ioctl+0x1114/0x24b1 [<ffffffff81140698>] ? 
>> ____cache_alloc+0x1c/0x29b [<ffffffff81140a06>] ? 
>> kmem_cache_alloc_node+0xef/0x179 [<ffffffff8160d7b3>] ? 
>> _raw_spin_unlock+0x17/0x2a [<ffffffff81163ade>] 
>> do_vfs_ioctl+0x3d2/0x41d [<ffffffff8116bd00>] ? __fget+0x6f/0x79
>>  [<ffffffff81163b80>] SyS_ioctl+0x57/0x82 [<ffffffff8161426d>] 
>> system_call_fastpath+0x1a/0x1f
> 
(Continue reading)

Marc MERLIN | 3 Mar 23:05 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

On Mon, Mar 03, 2014 at 12:09:11PM -0500, Josef Bacik wrote:
> Ok I lied I just went ahead and did it, please let me know if this
> fixes it

This looked promising, but I still have the problem.

PM: Syncing filesystems ... done.
PM: Preparing system for mem sleep
Freezing user space processes ... 
Freezing of tasks failed after 20.005 seconds (1 tasks refusing to freeze, wq_busy=0):
btrfs           D ffff8800b9c60840     0 12711      1 0x00000084
 ffff8803bc475958 0000000000000086 ffff8803bc475fd8 ffff8800b9c60310
 00000000000141c0 ffff8800b9c60310 ffff8803cd8d8000 ffff8800ca31d300
 0000000000000000 ffff8803b2306b40 ffff8803cd8d8220 ffff8803bc475968
Call Trace:
 [<ffffffff8160c331>] schedule+0x73/0x75
 [<ffffffff8126eb7e>] scrub_pages+0x27e/0x426
 [<ffffffff810850c9>] ? finish_wait+0x65/0x65
 [<ffffffff81271964>] scrub_stripe+0xada/0xc9e
 [<ffffffff81271bfe>] scrub_chunk.isra.9+0xd6/0x10d
 [<ffffffff81271ea8>] scrub_enumerate_chunks+0x273/0x49f
 [<ffffffff81085000>] ? prepare_to_wait_event+0xba/0xf2
 [<ffffffff81272674>] btrfs_scrub_dev+0x254/0x3cb
 [<ffffffff8116dde3>] ? __mnt_want_write+0x62/0x78
 [<ffffffff81255e9a>] btrfs_ioctl+0x1114/0x24b1
 [<ffffffff8114069b>] ? ____cache_alloc+0x1c/0x29b
 [<ffffffff81140a09>] ? kmem_cache_alloc_node+0xef/0x179
 [<ffffffff8160ea0b>] ? _raw_spin_unlock+0x17/0x2a
 [<ffffffff81163b16>] do_vfs_ioctl+0x3d2/0x41d
 [<ffffffff8116bd38>] ? __fget+0x6f/0x79
(Continue reading)

Josef Bacik | 3 Mar 23:18 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep


On 03/03/2014 05:05 PM, Marc MERLIN wrote:
> On Mon, Mar 03, 2014 at 12:09:11PM -0500, Josef Bacik wrote:
>> Ok I lied I just went ahead and did it, please let me know if
>> this fixes it
> 
> This looked promising, but I still have the problem.
> 
> PM: Syncing filesystems ... done. PM: Preparing system for mem
> sleep Freezing user space processes ... Freezing of tasks failed
> after 20.005 seconds (1 tasks refusing to freeze, wq_busy=0): btrfs
> D ffff8800b9c60840     0 12711      1 0x00000084 ffff8803bc475958
> 0000000000000086 ffff8803bc475fd8 ffff8800b9c60310 00000000000141c0
> ffff8800b9c60310 ffff8803cd8d8000 ffff8800ca31d300 0000000000000000
> ffff8803b2306b40 ffff8803cd8d8220 ffff8803bc475968 Call Trace: 
> [<ffffffff8160c331>] schedule+0x73/0x75 [<ffffffff8126eb7e>]
> scrub_pages+0x27e/0x426 [<ffffffff810850c9>] ?
> finish_wait+0x65/0x65 [<ffffffff81271964>]
> scrub_stripe+0xada/0xc9e [<ffffffff81271bfe>]
> scrub_chunk.isra.9+0xd6/0x10d [<ffffffff81271ea8>]
> scrub_enumerate_chunks+0x273/0x49f [<ffffffff81085000>] ?
> prepare_to_wait_event+0xba/0xf2 [<ffffffff81272674>]
> btrfs_scrub_dev+0x254/0x3cb [<ffffffff8116dde3>] ?
> __mnt_want_write+0x62/0x78 [<ffffffff81255e9a>]
> btrfs_ioctl+0x1114/0x24b1 [<ffffffff8114069b>] ?
> ____cache_alloc+0x1c/0x29b [<ffffffff81140a09>] ?
> kmem_cache_alloc_node+0xef/0x179 [<ffffffff8160ea0b>] ?
> _raw_spin_unlock+0x17/0x2a [<ffffffff81163b16>]
> do_vfs_ioctl+0x3d2/0x41d [<ffffffff8116bd38>] ? __fget+0x6f/0x79 
> [<ffffffff81163bb8>] SyS_ioctl+0x57/0x82 [<ffffffff816154ad>]
(Continue reading)

Marc MERLIN | 4 Mar 00:13 2014

Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

On Mon, Mar 03, 2014 at 05:18:33PM -0500, Josef Bacik wrote:
> > Maybe it will work if we cancel the scrub as opposed to pausing it,
> > but of course it's not ideal. Is that the next step?
> 
> Sigh I thought the PM stuff called freeze_fs() but I think that was
> just tuxonice.  I don't have a quick fix at the moment, I really will
> have to wait on this until after qgroups.  Thanks,

That's ok, thanks for giving it a shot.

For now, I just stuck this in /etc/acpi/sleep.sh
awk '/btrfs/ { print $1 }' /proc/mounts | sort -u | while read fs; do btrfs scrub cancel $fs; done

Not great, but it ensures my laptop will go to sleep and not kill my
batteries with the lid closed :)

Marc
--

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane