linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 5/5] f2fs: do not skip any writes under memory pressure
Date: Sat,  8 Nov 2014 23:36:09 -0800	[thread overview]
Message-ID: <1415518569-20626-5-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1415518569-20626-1-git-send-email-jaegeuk@kernel.org>

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

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/segment.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 6723ccc..7f327c0 100644
--- a/fs/f2fs/segment.h
+++ b/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)
 {
+	if (sbi->sb->s_bdi->dirty_exceeded)
+		return 0;
+
 	if (type == DATA)
 		return sbi->blocks_per_seg;
 	else if (type == NODE)
-- 
2.1.1


------------------------------------------------------------------------------

  parent reply	other threads:[~2014-11-09  7:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09  7:36 [PATCH 1/5] f2fs: disable roll-forward when active_logs = 2 Jaegeuk Kim
2014-11-09  7:36 ` [PATCH 2/5] f2fs: introduce the number of inode entries Jaegeuk Kim
2014-11-09  7:36 ` [PATCH 3/5] f2fs: control the memory footprint used by ino entries Jaegeuk Kim
2014-11-10  3:28   ` [f2fs-dev] " Changman Lee
2014-11-10  5:20     ` Jaegeuk Kim
2014-11-09  7:36 ` [PATCH 4/5] f2fs: write node pages if checkpoint is not doing Jaegeuk Kim
2014-11-10  7:37   ` [f2fs-dev] " Changman Lee
2014-11-09  7:36 ` Jaegeuk Kim [this message]
2014-11-10  9:54 ` [f2fs-dev] [PATCH 1/5] f2fs: disable roll-forward when active_logs = 2 Changman Lee
2014-11-10 15:07   ` Jaegeuk Kim
2014-11-11 22:43     ` [f2fs-dev] " Changman Lee
2014-11-14  1:21       ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415518569-20626-5-git-send-email-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).