linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger@applied-asynchrony.com>
To: linux-btrfs@vger.kernel.org,
	Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>,
	Naohiro Aota <naohiro.aota@hgst.com>
Subject: Re: [PATCH v3] btrfs: should block unused block groups deletion work when allocating data space
Date: Fri, 9 Sep 2016 12:56:57 +0200	[thread overview]
Message-ID: <57D29579.1080700@applied-asynchrony.com> (raw)
In-Reply-To: <pan$db9b8$41125892$42517798$e874738e@applied-asynchrony.com>

On 09/09/16 12:18, Holger Hoffstätte wrote:
> On Fri, 09 Sep 2016 16:17:48 +0800, Wang Xiaoguang wrote:
> 
>> cleaner_kthread() may run at any time, in which it'll call btrfs_delete_unused_bgs()
>> to delete unused block groups. Because this work is asynchronous, it may also result
>> in false ENOSPC error. 
> <snip>
> 
> With this v3 I can now no longer balance (tested only with metadata).
> New chunks are allocated (as balance does) but nothing ever shrinks, until
> after unmount/remount, when the cleaner eventually kicks in.
> 
> This might be related to the recent patch by Naohiro Aota:
> "btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs"
> 
> which by itself doesn't seem to do any harm (i.e. everything still seems
> to work as expected).

Actually even that is not true; both patches seem to be wrong in subtle
ways. Naohiro's patch seems to prevent the deletion during balance, whereas
yours prevents the cleaner from kicking in.

As a simple reproducer you can convert from -mdup to -msingle (to create
bloat) and then balance with -musage=10. Depending on which of the two
patches are applied, you end with bloat that only grows and never shrinks,
or bloat that ends up in mixed state (dup and single).

Undoing both makes both balancing and cleaning work again.

-h


  reply	other threads:[~2016-09-09 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  8:17 [PATCH v3] btrfs: should block unused block groups deletion work when allocating data space Wang Xiaoguang
2016-09-09  8:25 ` Wang Xiaoguang
2016-09-09  9:02   ` David Sterba
2016-09-09 10:18 ` Holger Hoffstätte
2016-09-09 10:56   ` Holger Hoffstätte [this message]
2016-09-12  7:38     ` Wang Xiaoguang
2016-09-12  8:19       ` Holger Hoffstätte
2016-09-10  6:04 ` Stefan Priebe - Profihost AG
  -- strict thread matches above, loose matches on Subject: below --
2016-07-25 13:32 [PATCH v2 4/4] " Josef Bacik
2016-07-26 12:04 ` [PATCH v3] " Wang Xiaoguang
2016-07-26 15:51   ` Josef Bacik
2016-07-26 16:25     ` David Sterba
2016-07-27  1:26     ` Wang Xiaoguang

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=57D29579.1080700@applied-asynchrony.com \
    --to=holger@applied-asynchrony.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@hgst.com \
    --cc=wangxg.fnst@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).