linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Timofey Titovets <nefelim4ag@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4] Btrfs: compress_file_range() change page dirty status once
Date: Tue, 5 Dec 2017 00:27:58 +0100	[thread overview]
Message-ID: <20171204232758.GF3553@twin.jikos.cz> (raw)
In-Reply-To: <20171023222948.10648-1-nefelim4ag@gmail.com>

On Tue, Oct 24, 2017 at 01:29:48AM +0300, Timofey Titovets wrote:
> We need to call extent_range_clear_dirty_for_io()
> on compression range to prevent application from changing
> page content, while pages compressing.
> 
> extent_range_clear_dirty_for_io() run on each loop iteration,
> "(end - start)" can be much (up to 1024 times) bigger
> then compression range (BTRFS_MAX_UNCOMPRESSED).
> 
> That produce extra calls to page managment code.
> 
> Fix that behaviour by call extent_range_clear_dirty_for_io()
> only once.
> 
> v1 -> v2:
>  - Make that more obviously and more safeprone
> 
> v2 -> v3:
>  - Rebased on:
>    Btrfs: compress_file_range() remove dead variable num_bytes
>  - Update change log
>  - Add comments
> 
> v3 -> v4:
>  - Rebased on: kdave for-next
>  - To avoid dirty bit clear/set behaviour change
>    call clear_bit once, istead of per compression range

This version looks safe to me. There's no functional difference if we
redirty the pages repeatedly, but there's probably a noticeable runtime
difference if we do it just once.

Reviewed-by: David Sterba <dsterba@suse.com>

      parent reply	other threads:[~2017-12-04 23:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 22:29 [PATCH v4] Btrfs: compress_file_range() change page dirty status once Timofey Titovets
2017-12-04 14:23 ` Timofey Titovets
2017-12-04 23:27 ` David Sterba [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=20171204232758.GF3553@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nefelim4ag@gmail.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).