All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: remove the dirty_page local variable
Date: Mon, 30 Sep 2024 14:01:58 -0400	[thread overview]
Message-ID: <20240930180158.GA667556@perftesting> (raw)
In-Reply-To: <274af9fcd34264fd6e74b707ac33f1544e73c655.1727660754.git.wqu@suse.com>

On Mon, Sep 30, 2024 at 11:20:29AM +0930, Qu Wenruo wrote:
> Inside btrfs_buffered_write(), we have a local variable @dirty_pages,
> recording the number of pages we dirtied in the current iteration.
> 
> However we do not really need that variable, since it can be calculated
> from @pos and @copied.
> 
> In fact there is already a problem inside the short copy path, where we
> use @dirty_pages to calculate the range we need to release.
> But that usage assumes sectorsize == PAGE_SIZE, which is no longer true.
> 
> Instead of keeping @dirty_pages and cause incorrect usage, just
> calculate the number of dirtied pages inside btrfs_dirty_pages().
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

  reply	other threads:[~2024-09-30 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  1:50 [PATCH 0/2] btrfs: small cleanups to buffered write path Qu Wenruo
2024-09-30  1:50 ` [PATCH 1/2] btrfs: remove the dirty_page local variable Qu Wenruo
2024-09-30 18:01   ` Josef Bacik [this message]
2024-09-30  1:50 ` [PATCH 2/2] btrfs: simplify the page uptodate preparation for prepare_pages() Qu Wenruo
2024-09-30 18:04   ` Josef Bacik
2024-10-01 15:20   ` David Sterba
2024-10-01 21:09     ` Qu Wenruo

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=20240930180158.GA667556@perftesting \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 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.