From: Josef Bacik <jbacik@fusionio.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 5/5] Btrfs: reclaim the reserved metadata space at background
Date: Fri, 22 Nov 2013 12:48:19 -0500 [thread overview]
Message-ID: <20131122174819.GA26620@localhost.localdomain> (raw)
In-Reply-To: <1385041398-8521-5-git-send-email-miaox@cn.fujitsu.com>
On Thu, Nov 21, 2013 at 09:43:18PM +0800, Miao Xie wrote:
> Before applying this patch, the task had to reclaim the metadata space
> by itself if the metadata space was not enough. And When the task started
> the space reclamation, all the other tasks which wanted to reserve the
> metadata space were blocked. At some cases, they would be blocked for
> a long time, it made the performance fluctuate wildly.
>
So the reason the flushing is done this way is because of this level of hell
called "early enospc." Basically we'd get people flushing randomly and other
users would come in and use the reclaimed space, so whoever was flushing would
often ENOSPC because they thought they did everything they could to flush and
still couldn't make allocations. This approach is a nice balance keeping the
old "one at a time" flushers and adding a background flusher, but I still worry
about people competing with the background flushing.
Consider the case where the background flusher has started and taken all of the
ordered extents on the system to flush (and lets assume that we only have
reservations tied up in ordered extents, which is very possible). Then a task
comes in to make a reservation but it can't because it doesn't have space, so it
tries to flush. But the inline flushing stuff doesn't find any ordered extents
to flush because they've been spliced off the list by the background flusher.
So we bail out and do -ENOSPC even though there is plenty of space.
What I would like to see is some way for a flusher who has to flush inline be
able to see that there is a background flusher and wait for it to finish its
work before doing its own flushing. If I have to start tracking down early
ENOSPC problems again I may very well quit doing file system work forever.
Thanks,
Josef
next prev parent reply other threads:[~2013-11-22 17:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 13:43 [PATCH 1/5] Btrfs: wake up the tasks that wait for the io earlier Miao Xie
2013-11-21 13:43 ` [PATCH 2/5] Btrfs: just do diry page flush for the inode with compression before direct IO Miao Xie
2013-11-21 13:43 ` [PATCH 3/5] Btrfs: remove the unnecessary flush when preparing the pages Miao Xie
2013-11-21 13:43 ` [PATCH 4/5] Btrfs: remove unnecessary lock in may_commit_transaction() Miao Xie
2013-11-21 13:43 ` [PATCH 5/5] Btrfs: reclaim the reserved metadata space at background Miao Xie
2013-11-22 17:48 ` Josef Bacik [this message]
2013-11-22 4:30 ` [PATCH 1/5] Btrfs: wake up the tasks that wait for the io earlier Liu Bo
2013-11-22 7:28 ` Miao Xie
2013-11-22 8:47 ` Liu Bo
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=20131122174819.GA26620@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
/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).