Re: [PATCH 12/35] btrfs: add ALLOC_CHUNK_FORCE to the flushing code

Josef Bacik
2018-09-04T22:24:09Z

On Mon, Sep 03, 2018 at 05:19:19PM +0300, Nikolay Borisov wrote:
>
>
> On 30.08.2018 20:42, Josef Bacik wrote:
> > + if (flush_state == ALLOC_CHUNK_FORCE && !commit_cycles)
> > + flush_state++;
>
> This is a bit obscure. So if we allocated a chunk and !commit_cycles
> just break from the loop? What's the reasoning behind this ?

I'll add a comment, but it doesn't break the loop, it just goes to COMMIT_TRANS.
The idea is we don't want to force a chunk allocation if we're experiencing a
little bit of pressure, because we could end up with a drive full of empty
metadata chunks. We want to try committing the transaction first, and then if
we still have issues we can force a chunk allocation. Thanks,

Josef