All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
To: Liu Bo <bo.li.liu@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] Btrfs: make mapping->writeback_index point to the last written page
Date: Tue, 8 Mar 2016 13:34:54 +0100	[thread overview]
Message-ID: <56DEC6EE.9000002@googlemail.com> (raw)
In-Reply-To: <1457398582-12606-1-git-send-email-bo.li.liu@oracle.com>

On 03/08/16 01:56, Liu Bo wrote:
> If sequential writer is writing in the middle of the page and it just redirties
> the last written page by continuing from it.
> 
> In the above case this can end up with seeking back to that firstly redirtied
> page after writing all the pages at the end of file because btrfs updates
> mapping->writeback_index to 1 past the current one.
> 
> For non-cow filesystems, the cost is only about extra seek, while for cow 
> filesystems such as btrfs, it means unnecessary fragments.
> 
> To avoid it, we just need to continue writeback from the last written page.
> 
> This also updates btrfs to behave like what write_cache_pages() does, ie, bail
>  out immediately if there is an error in writepage().
> 
> <Ref: https://www.spinics.net/lists/linux-btrfs/msg52628.html>
> 
> Reported-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Very nice, seems to work as advertised. Can't speak for the data integrity
implications, but for the functionality of both patches:

Tested-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>

Thank you!
Holger


      parent reply	other threads:[~2016-03-08 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  0:56 [PATCH 1/2] Btrfs: make mapping->writeback_index point to the last written page Liu Bo
2016-03-08  0:56 ` [PATCH 2/2] Btrfs: cleanup error handling in extent_write_cached_pages Liu Bo
2016-03-08 12:34 ` Holger Hoffstätte [this message]

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=56DEC6EE.9000002@googlemail.com \
    --to=holger.hoffstaette@googlemail.com \
    --cc=bo.li.liu@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 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.