From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: PATCH 1/2] ext4: stop looping in ext4_num_dirty_pages when max_pages reached
Date: Tue, 31 Aug 2010 08:59:06 -0500 [thread overview]
Message-ID: <4C7D0AAA.2080808@redhat.com> (raw)
In-Reply-To: <4C7D0A00.40601@redhat.com>
Today we simply break out of the inner loop when we have accumulated
max_pages; this keeps scanning forwad and doing pagevec_lookup_tag()
in the while (!done) loop, this does potentially a lot of work
with no net effect.
When we have accumulated max_pages, just clean up and return.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4b8debe..93497f6 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1207,8 +1207,10 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
break;
idx++;
num++;
- if (num >= max_pages)
- break;
+ if (num >= max_pages) {
+ pagevec_release(&pvec);
+ return num;
+ }
}
pagevec_release(&pvec);
}
next prev parent reply other threads:[~2010-08-31 13:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-31 13:56 [PATCH 0/2] ext4: a couple writeback path fixes Eric Sandeen
2010-08-31 13:59 ` Eric Sandeen [this message]
2010-08-31 14:04 ` [PATCH 2/2] ext4: don't bump nr_to_write if LONG_MAX Eric Sandeen
2010-08-31 14:20 ` [PATCH 2/2 V2] " Eric Sandeen
2010-09-03 21:37 ` Eric Sandeen
2010-09-03 22:11 ` [PATCH 0/2] ext4: a couple writeback path fixes Eric Sandeen
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=4C7D0AAA.2080808@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.