Skip to contentSkip to conversation

Change the total_dirty from SZ_256M to SZ_64M.

PATCH In review hmsjwzb 3 participants 3 messages Nov 3, 2018 Btrfs file system

lore
Share & tools
lore

hmsjwzb

author
#0 lore raw

PATCH 1/1 Change the total_dirty from SZ_256M to SZ_64M.

The SZ_256M will cause trouble in platform with less than 256M memory. For example, a qemu virtual machine.

---
 fs/btrfs/tests/extent-io-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tests/extent-io-tests.c +1 -1
index 9e0f4a01be14..cb23dce96a2d 100644
@@ -62,7 +62,7 @@ static int test_find_delalloc(u32 sectorsize)
 	struct page *page;
 	struct page *locked_page = NULL;
 	unsigned long index = 0;
-	u64 total_dirty = SZ_256M;
+	u64 total_dirty = SZ_64M;
 	u64 max_bytes = SZ_128M;
 	u64 start, end, test_start;
 	u64 found;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · hmsjwzb

The SZ_256M will cause trouble in platform with less than 256M memory. For example, a qemu virtual machine.

If you have actually taken the care to understand the code in test_find_delalloc you would have seen that total_dirty and max_bytes are actually inter-dependent so you cannot really change total_bytes without adjusting max_bytes as well. Otherwise tests will start breaking.

NACK on this (and likely any future postings of this) since the tests are sized in a such a way so as to test design limits (such as the max extent size which is 128MB)

Quoted 18 lines
---
 fs/btrfs/tests/extent-io-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tests/extent-io-tests.c +1 -1
index 9e0f4a01be14..cb23dce96a2d 100644
@@ -62,7 +62,7 @@ static int test_find_delalloc(u32 sectorsize)
 	struct page *page;
 	struct page *locked_page = NULL;
 	unsigned long index = 0;
-	u64 total_dirty = SZ_256M;
+	u64 total_dirty = SZ_64M;
 	u64 max_bytes = SZ_128M;
 	u64 start, end, test_start;
 	u64 found;
#2 lore raw
Quoted 6 lines · Nikolay Borisov
Quoted 3 lines · hmsjwzb

The SZ_256M will cause trouble in platform with less than 256M memory. For example, a qemu virtual machine.

Quoted 6 lines
Quoted 1 line

If you have actually taken the care to understand the code in test_find_delalloc you would have seen that total_dirty and max_bytes are actually inter-dependent so you cannot really change total_bytes without adjusting max_bytes as well. Otherwise tests will start breaking.

Nowadays even for VM, the memory size should start from 2G. If this 256M is causing problem, one should really re-consider the memory size of the VM.

Not to mention the magic number is two ensure we have at least 2 file extents.

Quoted 4 lines

NACK on this (and likely any future postings of this) since the tests are sized in a such a way so as to test design limits (such as the max extent size which is 128MB)

And we should add some comment about this.

Personally I prefer some comment with this and also use (2 * BTRFS_MAX_EXTENT_SIZE) other than this intermediate number.

Thanks,
Qu

Quoted 20 lines
Quoted 20 lines

---
 fs/btrfs/tests/extent-io-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tests/extent-io-tests.c +1 -1
index 9e0f4a01be14..cb23dce96a2d 100644
@@ -62,7 +62,7 @@ static int test_find_delalloc(u32 sectorsize)
 	struct page *page;
 	struct page *locked_page = NULL;
 	unsigned long index = 0;
-	u64 total_dirty = SZ_256M;
+	u64 total_dirty = SZ_64M;
 	u64 max_bytes = SZ_128M;
 	u64 start, end, test_start;
 	u64 found;