linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: ira.weiny@intel.com
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	Miao Xie <miaox@cn.fujitsu.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/btrfs: Fix raid6 qstripe kmap'ing
Date: Wed, 3 Feb 2021 16:56:48 +0100	[thread overview]
Message-ID: <20210203155648.GE1993@suse.cz> (raw)
In-Reply-To: <20210128061503.1496847-1-ira.weiny@intel.com>

On Wed, Jan 27, 2021 at 10:15:03PM -0800, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> When a qstripe is required an extra page is allocated and mapped.  There
> were 3 problems.
> 
> 1) There is no reason to map the qstripe page more than 1 time if the
>    number of bits set in rbio->dbitmap is greater than one.
> 2) There is no reason to map the parity page and unmap it each time
>    through the loop.
> 3) There is no corresponding call of kunmap() for the qstripe page.
> 
> The page memory can continue to be reused with a single mapping on each
> iteration by raid6_call.gen_syndrome() without remapping.  So map the
> page for the duration of the loop.
> 
> Similarly, improve the algorithm by mapping the parity page just 1 time.
> 
> Fixes: 5a6ac9eacb49 ("Btrfs, raid56: support parity scrub on raid56")
> To: Chris Mason <clm@fb.com>
> To: Josef Bacik <josef@toxicpanda.com>
> To: David Sterba <dsterba@suse.com>
> Cc: Miao Xie <miaox@cn.fujitsu.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> 
> ---
> This was found while replacing kmap() with kmap_local_page().  After
> this patch unwinding all the mappings becomes pretty straight forward.
> 
> I'm not exactly sure I've worded this commit message intelligently.
> Please forgive me if there is a better way to word it.

Changelog is good, thanks. I've added stable tags as the missing unmap
is a potential problem.

  reply	other threads:[~2021-02-03 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  6:15 [PATCH] fs/btrfs: Fix raid6 qstripe kmap'ing ira.weiny
2021-02-03 15:56 ` David Sterba [this message]
2021-02-04 15:26   ` David Sterba
2021-02-05  3:52     ` Ira Weiny
2021-02-05 15:34       ` David Sterba
2021-02-05 16:39         ` Ira Weiny

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=20210203155648.GE1993@suse.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=ira.weiny@intel.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaox@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).