mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org>
Subject: [PATCH 2/2] f2fs: rename nr_pages_to_skip with nr_caches_to_skip
Date: Sat, 12 Sep 2026 07:25:10 +0800	[thread overview]
Message-ID: <20260911232510.1816298-2-chao@kernel.org> (raw)
In-Reply-To: <20260911232510.1816298-1-chao@kernel.org>

From: Jaegeuk Kim <jaegeuk@kernel.org>

The skipped count does not indicate the number of pages anymore.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/checkpoint.c |  2 +-
 fs/f2fs/data.c       |  2 +-
 fs/f2fs/node.c       |  2 +-
 fs/f2fs/segment.h    | 10 +++++-----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 1ff9f241085a..a898258f6308 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -591,7 +591,7 @@ void f2fs_write_meta_caches(struct f2fs_sb_info *sbi)
 
 	/* collect a number of dirty meta caches and write together */
 	if (get_nr_caches(sbi, F2FS_DIRTY_META) <
-			nr_pages_to_skip(sbi, META))
+	    nr_caches_to_skip(sbi, META))
 		return;
 
 	/* if locked failed, cp will flush dirty caches instead */
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 49fe48ae823d..fe7138797a61 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3797,7 +3797,7 @@ static int __f2fs_write_data_pages(struct address_space *mapping,
 
 	if ((S_ISDIR(inode->i_mode) || IS_NOQUOTA(inode)) &&
 			wbc->sync_mode == WB_SYNC_NONE &&
-			get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
+			get_dirty_pages(inode) < nr_caches_to_skip(sbi, DATA) &&
 			f2fs_available_free_memory(sbi, DIRTY_DENTS))
 		goto skip_write;
 
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a185b794b7b5..1f023522474a 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2270,7 +2270,7 @@ int f2fs_write_node_caches(struct f2fs_sb_info *sbi)
 
 	/* collect a number of dirty node caches and write together */
 	if (get_nr_caches(sbi, F2FS_DIRTY_NODES) <
-					nr_pages_to_skip(sbi, NODE))
+					nr_caches_to_skip(sbi, NODE))
 		return -EAGAIN;
 
 	if (atomic_read(&sbi->wb_sync_req[NODE])) {
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index b77fc79907f8..526764ba31ae 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -977,13 +977,13 @@ static inline bool sec_usage_check(struct f2fs_sb_info *sbi, unsigned int secno)
 }
 
 /*
- * It is very important to gather dirty pages and write at once, so that we can
+ * It is very important to gather dirty blocks and write at once, so that we can
  * submit a big bio without interfering other data writes.
- * By default, 512 pages for directory data,
- * 512 pages (2MB) * 8 for nodes, and
- * 256 pages * 8 for meta are set.
+ * By default, 512 blocks for directory data,
+ * 512 blocks (2MB) * 8 for nodes, and
+ * 256 blocks * 8 for meta are set.
  */
-static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
+static inline int nr_caches_to_skip(struct f2fs_sb_info *sbi, int type)
 {
 	if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi))
 		return 0;
-- 
2.49.0


      reply	other threads:[~2026-09-11 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 23:25 [PATCH 1/2] f2fs: rename page_count with cache_count Chao Yu
2026-09-11 23:25 ` Chao Yu [this message]

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=20260911232510.1816298-2-chao@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --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

all inboxes | Powered by JetHome®