summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authortuxoko <[email protected]>2015-10-30 16:10:01 -0700
committerNed Bass <[email protected]>2015-12-23 17:29:35 -0800
commita3fcc7c48bb8051153dd791ecac0f64d6ad6c6e0 (patch)
treec2b9e467cce82c0314ccfa4bd74a5fb4dbd803a6 /module/zfs
parentbecc31dda7a310dc69b39d7a177c55c04f1f5c9b (diff)
Fix zfs_dirty_data_max overflow on 32-bit
On 32 bit, the calculation of zfs_dirty_data_max from phymem will overflow, causing it to be smaller than zfs_dirty_data_sync, and will cause txg being delayed while no one write to disk. The end result is horrendous write speed. On 4G ram 32-bit VM, before this patch, simple dd results in ~7MB/s. Now it can reach speed on par with 64-bit VM. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3973
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/arc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index ec9b46b02..729f8936e 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -5478,11 +5478,11 @@ arc_init(void)
* zfs_dirty_data_max_max (default 25% of physical memory).
*/
if (zfs_dirty_data_max_max == 0)
- zfs_dirty_data_max_max = physmem * PAGESIZE *
+ zfs_dirty_data_max_max = (uint64_t)physmem * PAGESIZE *
zfs_dirty_data_max_max_percent / 100;
if (zfs_dirty_data_max == 0) {
- zfs_dirty_data_max = physmem * PAGESIZE *
+ zfs_dirty_data_max = (uint64_t)physmem * PAGESIZE *
zfs_dirty_data_max_percent / 100;
zfs_dirty_data_max = MIN(zfs_dirty_data_max,
zfs_dirty_data_max_max);