浏览代码

f2fs: do not skip any writes under memory pressure

Under memory pressure, let's avoid skipping data writes.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim 11 年之前
父节点
当前提交
510184c89f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      fs/f2fs/segment.h

+ 3 - 0
fs/f2fs/segment.h

@@ -711,6 +711,9 @@ static inline unsigned int max_hw_blocks(struct f2fs_sb_info *sbi)
  */
  */
 static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
 static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
 {
 {
+	if (sbi->sb->s_bdi->dirty_exceeded)
+		return 0;
+
 	if (type == DATA)
 	if (type == DATA)
 		return sbi->blocks_per_seg;
 		return sbi->blocks_per_seg;
 	else if (type == NODE)
 	else if (type == NODE)