linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Itaru Kitayama <kitayama@cl.bb4u.ne.jp>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs: shrink_delalloc check bdi write congested
Date: Sat, 29 Sep 2012 22:20:09 +0900	[thread overview]
Message-ID: <CANW9uyu_-DFmggZUyAc1OOd0knMxEp-O3GPcs_8ZsoXAxm0DZg@mail.gmail.com> (raw)

In srhink_delalloc(), writeback starts if idle, also check the bdi is
not write congested.
The patch is against the head of the btrfs-next.

Signed-off-by: Itaru Kitayama <kitayama@cl.bb4u.ne.jp>

 fs/btrfs/extent-tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index efb044e..caa74d3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3712,7 +3712,7 @@ static void shrink_delalloc(struct btrfs_root *root, u64 t
        while (delalloc_bytes && loops < 3) {
                max_reclaim = min(delalloc_bytes, to_reclaim);
                nr_pages = max_reclaim >> PAGE_CACHE_SHIFT;
-               writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages,
+               if (!bdi_write_congested(root->fs_info->sb->s_bdi)) writeback_in
                                               WB_REASON_FS_FREE_SPACE);

                /*

             reply	other threads:[~2012-09-29 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29 13:20 Itaru Kitayama [this message]
2012-09-29 16:21 ` [PATCH] Btrfs: shrink_delalloc check bdi write congested David Sterba
2012-09-30  1:28   ` Itaru Kitayama
2012-09-30  2:11     ` Itaru Kitayama
2012-09-30 22:29       ` David Sterba
2012-09-30 23:55         ` Itaru Kitayama
2012-10-01  0:10           ` David Sterba

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=CANW9uyu_-DFmggZUyAc1OOd0knMxEp-O3GPcs_8ZsoXAxm0DZg@mail.gmail.com \
    --to=kitayama@cl.bb4u.ne.jp \
    --cc=linux-btrfs@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).