|
@@ -2993,11 +2993,18 @@ static int ext4_nonda_switch(struct super_block *sb)
|
|
if (2 * free_blocks < 3 * dirty_blocks ||
|
|
if (2 * free_blocks < 3 * dirty_blocks ||
|
|
free_blocks < (dirty_blocks + EXT4_FREEBLOCKS_WATERMARK)) {
|
|
free_blocks < (dirty_blocks + EXT4_FREEBLOCKS_WATERMARK)) {
|
|
/*
|
|
/*
|
|
- * free block count is less that 150% of dirty blocks
|
|
|
|
- * or free blocks is less that watermark
|
|
|
|
|
|
+ * free block count is less than 150% of dirty blocks
|
|
|
|
+ * or free blocks is less than watermark
|
|
*/
|
|
*/
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
|
|
+ * Even if we don't switch but are nearing capacity,
|
|
|
|
+ * start pushing delalloc when 1/2 of free blocks are dirty.
|
|
|
|
+ */
|
|
|
|
+ if (free_blocks < 2 * dirty_blocks)
|
|
|
|
+ writeback_inodes_sb_if_idle(sb);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|