linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/5] btrfs: add fs flag to force device flushing
Date: Fri, 16 Jun 2017 16:03:03 +0200	[thread overview]
Message-ID: <20170616140303.GA21388@suse.cz> (raw)
In-Reply-To: <96590a3c-ba90-c671-2e23-d629834547a6@oracle.com>

On Fri, Jun 16, 2017 at 06:27:20AM +0800, Anand Jain wrote:
> 
> 
> 
> 
> >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> index 59a732a13370..659a3b4645d2 100644
> >> --- a/fs/btrfs/disk-io.c
> >> +++ b/fs/btrfs/disk-io.c
> >> @@ -3494,7 +3494,8 @@ static void write_dev_flush(struct btrfs_device 
> >> *device)
> >>       struct request_queue *q = bdev_get_queue(device->bdev);
> >>       struct bio *bio = device->flush_bio;
> >> -    if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
> >> +    if (!test_bit(BTRFS_FS_FORCE_DEV_FLUSH, &device->fs_info->flags)
> >> +        && !test_bit(QUEUE_FLAG_WC, &q->queue_flags))
> >>           return;
> > 
> > 
> >   Now I understand what you meant. But the most common case in our test
> >   set up is a device with write cache. So BTRFS_FS_FORCE_DEV_FLUSH does
> >   not bring any additional force. IMO.
> > 
> > Thanks, Anand
> 
>   Or one another idea is we could remove
> 
>     !test_bit(QUEUE_FLAG_WC, &q->queue_flags)
> 
>   which purpose is to only fail early.

I'd prefer to keep it that way.

>   If we remove it there is consistency in our code with or
>   with out the write cache.

  reply	other threads:[~2017-06-16 14:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 16:49 [PATCH 0/5] Preallocate flush bio, sysfs tunable David Sterba
2017-06-15 16:49 ` [PATCH 1/5] btrfs: preallocate device flush bio David Sterba
2017-06-15 21:53   ` Anand Jain
2017-06-16 13:17     ` David Sterba
2017-06-15 16:49 ` [PATCH 2/5] btrfs: account as waiting for IO, while waiting fot the flush bio completion David Sterba
2017-06-15 16:49 ` [PATCH 3/5] btrfs: move dev stats accounting out of wait_dev_flush David Sterba
2017-06-15 22:00   ` Anand Jain
2017-06-15 16:49 ` [PATCH 4/5] btrfs: add fs flag to force device flushing David Sterba
2017-06-15 22:08   ` Anand Jain
2017-06-15 22:27     ` Anand Jain
2017-06-16 14:03       ` David Sterba [this message]
2017-06-15 16:49 ` [PATCH 5/5] btrfs: sysfs: export the force_dev_flush flag David Sterba
2017-06-15 22:24   ` Anand Jain

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=20170616140303.GA21388@suse.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --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).