linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@meta.com>
To: Christoph Hellwig <hch@infradead.org>, Chris Mason <clm@fb.com>
Cc: linux-btrfs@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-mm@kvack.org
Subject: Re: What is the point of the wbc->for_kupdate check in btree_writepages
Date: Thu, 8 May 2025 10:33:24 -0400	[thread overview]
Message-ID: <2d1a8e78-b57a-4726-a566-4d916a36be8f@meta.com> (raw)
In-Reply-To: <aBxJ8uBi5Cgz-CPu@infradead.org>

On 5/8/25 2:06 AM, Christoph Hellwig wrote:
> Hi Chris,
> 
> you added a wbc->for_kupdate check to btree_writepages that skips the
> write in this case in commit 448d640b668d ("Btrfs: Fine tune the btree
> writeback exclusion some more") which is not associated without any
> information but the subject line.
> 
> Do you by any chance remember why it was doing that just for kupdate
> and not any other background writeback?  I'm asking because it is one
> of only two checks for this in file system code, and the other one
> in nfs at least checks for all background writeback and thus makes
> some sense to me.

Hi Christoph,

btrfs can keep changing dirty tree blocks in memory, but once we write
them, we have to recow.  Between transaction writeback kicking in every
30 seconds and us calling balance_dirty_pages on the btree inode,
kupdate was doing more harm than good (back in 2007).

Is the goal to get rid of for_kupdate?  I wonder if we can just flag the
btree inode to exclude from kupdate, or keep it off whatever list
kupdate cares about etc.

-chris


  reply	other threads:[~2025-05-08 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  6:06 Christoph Hellwig
2025-05-08 14:33 ` Chris Mason [this message]
2025-05-08 14:41   ` Christoph Hellwig
2025-05-08 16:11     ` Chris Mason

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=2d1a8e78-b57a-4726-a566-4d916a36be8f@meta.com \
    --to=clm@meta.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-mm@kvack.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