-------- Original Message --------
Subject: Re: [PATCH] btrfs: Enhance btrfs chunk allocation algorithm to
reduce ENOSPC caused by unbalanced data/metadata allocation.
From: Liu Bo <bo.li....@oracle.com>
To: Qu Wenruo <quwen...@cn.fujitsu.com>
Date: 2014年10月30日 17:39
On Thu, Oct 30, 2014 at 11:46:18AM +0800, Qu Wenruo wrote:
[snipped]
Okay, I buy this.
Thanks,
Qu
Thanks,
Qu
[snipped]
/*
+ * Try not to occupy more than half of the unallocated space.
+ * When run short of space and alloc all the space to
+ * data/metadata will cause ENOSPC to be
triggered more easily.
+ *
+ * And since the minimum chunk size is 16M, the
half-half will cause
+ * 16M allocated from 20M available space and
reset 4M will not be
+ * used ever. In that case(16~32M), allocate all directly.
+ */
+ if (total_avail_space < 32 * 1024 * 1024 &&
+ total_avail_space > 16 * 1024 * 1024)
+ max_chunk_size = total_avail_space;
+ else
+ max_chunk_size = min(total_avail_space / 2,
max_chunk_size);
+ max_chunk_size = min(total_avail_space / 2, max_chunk_size);
^^^^^^^^
Why another one? This won't make it use all space within [16M, 32M].
thanks,
-liubo
Sorry for the later reply, I didn't notice the mail for a long time.
Yes, that's my mistake setting the size twice...
Will fix it soon.
Thanks,
Qu
+
+ /*
* now sort the devices by hole size / available space
*/
sort(devices_info, ndevs, sizeof(struct btrfs_device_info),
--
2.1.2
--
To unsubscribe from this list: send the line
"unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html