There are several allocations going on, filesystem is the writeback path and transaction commit path, MM is in direct reclaim path. Part of the problem could be in the btrfs writeback handlers that seem to want some memory to proceed ... [ 1388.431005] [<ffffffff811a3f2f>] kmem_cache_alloc+0x1ef/0x470 [ 1388.431005] [<ffffffffa02a6656>] alloc_extent_map+0x16/0x60 [btrfs] [ 1388.431005] [<ffffffffa02a34ed>] btrfs_drop_extent_cache+0x10d/0x440 [btrfs] [ 1388.431005] [<ffffffffa02977c5>] cow_file_range+0xe5/0x420 [btrfs] [ 1388.431005] [<ffffffffa0297eb6>] run_delalloc_nocow+0x3b6/0xb50 [btrfs] [ 1388.431005] [<ffffffffa0298998>] run_delalloc_range+0x348/0x360 [btrfs] [ 1388.431005] [<ffffffffa02ae73e>] writepage_delalloc.isra.34+0xfe/0x160 [btrfs] [ 1388.431005] [<ffffffffa02af381>] __extent_writepage+0xc1/0x2e0 [btrfs] [ 1388.431005] [<ffffffffa02af84f>] extent_write_cache_pages.isra.29.constprop.48+0x2af/0x360 [btrfs] [ 1388.431005] [<ffffffffa02b15ed>] extent_writepages+0x4d/0x60 [btrfs] [ 1388.431005] [<ffffffff811e5cdd>] __writeback_single_inode+0x3d/0x2a0 [ 1388.431005] [<ffffffff811e6b10>] writeback_sb_inodes+0x220/0x3c0 [ 1388.431005] [<ffffffff811e6d46>] __writeback_inodes_wb+0x96/0xc0 [ 1388.431005] [<ffffffff811e6f8b>] wb_writeback+0x21b/0x330 ... same as the transaction commit wants memory: ... [ 1388.431005] [<ffffffffa02b1e04>] alloc_extent_buffer+0xe4/0x370 [btrfs] [ 1388.431005] [<ffffffffa027e543>] btrfs_alloc_free_block+0x113/0x450 [btrfs] [ 1388.431005] [<ffffffffa0268683>] __btrfs_cow_block+0x133/0x590 [btrfs] [ 1388.431005] [<ffffffffa0268c9d>] btrfs_cow_block+0x11d/0x1f0 [btrfs] [ 1388.431005] [<ffffffffa026cc3c>] btrfs_search_slot+0x20c/0xad0 [btrfs] [ 1388.431005] [<ffffffffa026ee73>] btrfs_insert_empty_items+0x63/0xb0 [btrfs] [ 1388.431005] [<ffffffffa0276c72>] alloc_reserved_file_extent+0x92/0x340 [btrfs] [ 1388.431005] [<ffffffffa027bdb9>] __btrfs_run_delayed_refs+0xae9/0x1290 [btrfs] [ 1388.431005] [<ffffffffa02804cc>] btrfs_run_delayed_refs.part.67+0x6c/0x280 [btrfs] [ 1388.431005] [<ffffffffa0290c84>] btrfs_commit_transaction+0x24/0x60 [btrfs] [ 1388.431005] [<ffffffffa028cbe5>] transaction_kthread+0x1a5/0x230 [btrfs] ...