linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: limit the number of asynchronous delalloc pages to reasonable value
@ 2016-11-08  9:30 Wang Xiaoguang
  2016-11-21 16:39 ` David Sterba
  2016-11-21 17:59 ` Chris Mason
  0 siblings, 2 replies; 7+ messages in thread
From: Wang Xiaoguang @ 2016-11-08  9:30 UTC (permalink / raw)
  To: linux-btrfs

The current limit of number of asynchronous delalloc pages is (10 * SZ_1M).
For 4K page, the total ram bytes would be 40G, very big value, I think in
most cases, this limit will not work, here I set limit of the number of
asynchronous delalloc pages to SZ_1M(4GB ram bytes).

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8e3a5a2..3a910f6 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1158,7 +1158,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page,
 	struct btrfs_root *root = BTRFS_I(inode)->root;
 	unsigned long nr_pages;
 	u64 cur_end;
-	int limit = 10 * SZ_1M;
+	int limit = SZ_1M;
 
 	clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED,
 			 1, 0, NULL, GFP_NOFS);
-- 
2.5.0




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-22 14:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08  9:30 [PATCH] btrfs: limit the number of asynchronous delalloc pages to reasonable value Wang Xiaoguang
2016-11-21 16:39 ` David Sterba
2016-11-22  9:20   ` Wang Xiaoguang
2016-11-22 12:40     ` David Sterba
2016-11-22 14:32     ` Chris Mason
2016-11-21 17:59 ` Chris Mason
2016-11-22  9:30   ` Wang Xiaoguang

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).