From: Liu Bo <liubo2009@cn.fujitsu.com>
To: David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org, stable@vger.kernel.org,
Chris Mason <chris.mason@oracle.com>,
Josef Bacik <josef@redhat.com>
Subject: Re: [PATCH] Revert "Btrfs: increase the global block reserve estimates"
Date: Mon, 09 Apr 2012 09:37:08 +0800 [thread overview]
Message-ID: <4F823D44.5070200@cn.fujitsu.com> (raw)
In-Reply-To: <1333928451-26468-1-git-send-email-dsterba@suse.cz>
On 04/09/2012 07:40 AM, David Sterba wrote:
> This reverts commit 5500cdbe14d7435e04f66ff3cfb8ecd8b8e44ebf.
>
> We had numerous reports of premature ENOSPC that were bisected to this
> patch. Reverting will not break things but a warning in 'use_block_rsv'
> may show up in the syslog.
>
> There's no alternative fix in sight and the ENOSPC problem affects all
> 3.3 btrfs users during normal filesystem use.
>
Hi David,
(add cc Josef)
The whole thing is about our overcommit stuff, that is,
since we are not able to get _precise_ number of reservation right now, we usually
reserve more than what we need.
For this, we've done overcommit dance (thanks for Josef's work!) but it's still not
enough for our reservation when we still have some disk space.
I'm ok with this revert, but since we don't use up all the reserved space in most time,
I assume the following can be an alternative, thanks,
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a844204..1b692c2 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3844,6 +3844,7 @@ again:
spin_lock(&root->fs_info->free_chunk_lock);
avail = root->fs_info->free_chunk_space;
+ spin_unlock(&root->fs_info->free_chunk_lock);
/*
* If we have dup, raid1 or raid10 then only half of the free
@@ -3854,17 +3855,6 @@ again:
BTRFS_BLOCK_GROUP_RAID10))
avail >>= 1;
- /*
- * If we aren't flushing don't let us overcommit too much, say
- * 1/8th of the space. If we can flush, let it overcommit up to
- * 1/2 of the space.
- */
- if (flush)
- avail >>= 3;
- else
- avail >>= 1;
- spin_unlock(&root->fs_info->free_chunk_lock);
-
if (used + num_bytes < space_info->total_bytes + avail) {
space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info,
next prev parent reply other threads:[~2012-04-09 1:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-08 23:40 [PATCH] Revert "Btrfs: increase the global block reserve estimates" David Sterba
2012-04-09 1:37 ` Liu Bo [this message]
2012-04-09 22:40 ` David Sterba
2012-04-10 15:24 ` Chris Mason
2012-04-11 16:00 ` 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=4F823D44.5070200@cn.fujitsu.com \
--to=liubo2009@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=dsterba@suse.cz \
--cc=josef@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@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.