Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: Sun Yangkai <sunk67188@gmail.com>
Cc: kernel-team@fb.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: make periodic dynamic reclaim the default for data
Date: Mon, 29 Dec 2025 16:00:35 -0800	[thread overview]
Message-ID: <aVMWI7bVCZX4RAAa@devvm12410.ftw0.facebook.com> (raw)
In-Reply-To: <18e6a584-b6fb-47f9-b526-4e97798052a2@gmail.com>

On Fri, Dec 26, 2025 at 11:07:28AM +0800, Sun Yangkai wrote:
> Hi Boris,

First off, sorry for not replying promptly. I've been in and out of the
office around the holidays.

> 
> Thank you for bring such a feature for btrfs. I love it a lot and try to enable
> it on my machine.

I really appreciate your kind words and your interest in the feature.
Thank you!

> 
> But I've get into some unexpected behavior when periodic dynamic reclaim is
> enabled and the filesystem is nearly full.

Oops! Let's debug it :)

> 
> [12月26 10:41] [T20373] BTRFS info (device sda): relocating block group
> 5214541578240 flags data
> [  +0.012446] [T20373] BTRFS error (device sda): error relocating chunk
> 5214541578240
> [  +0.000033] [T20373] BTRFS info (device sda): relocating block group
> 4540021997568 flags data
> [  +0.008927] [T20373] BTRFS error (device sda): error relocating chunk
> 4540021997568
> [  +0.000025] [T20373] BTRFS info (device sda): relocating block group
> 5606746750976 flags data
> [12月26 10:42] [T20373] BTRFS error (device sda): error relocating chunk
> 5606746750976
> [12月26 10:47] [T12072] BTRFS info (device sda): relocating block group
> 5606746750976 flags data
> [  +3.960400] [T12072] BTRFS error (device sda): error relocating chunk
> 5606746750976
> [12月26 10:52] [ T7643] BTRFS info (device sda): relocating block group
> 5606746750976 flags data
> [  +3.960314] [ T7643] BTRFS error (device sda): error relocating chunk
> 5606746750976
> [12月26 10:57] [T20373] BTRFS info (device sda): relocating block group
> 5606746750976 flags data
> [  +3.954485] [T20373] BTRFS error (device sda): error relocating chunk
> 5606746750976
> [12月26 11:02] [ T7701] BTRFS info (device sda): relocating block group
> 5606746750976 flags data
> [  +4.561796] [ T7701] BTRFS error (device sda): error relocating chunk
> 5606746750976
> 
> I guess the condition of when the periodic reclaim should happen is unpolished.

Yeah, it looks like it is triggering too frequently in conditions where
it isn't likely to succeed. Hopefully we can tune up the heuristics (or
just fix the bug you found) and it works better.

It seems to be triggering every 5 minutes or so, right? Is that the
interval of the cleaner thread running on your system? Or am I
misinterpreting the time stamps? I would normally expect the default of
30s.

> 
> I'm still digging further into it.

Were you able to confirm whether that negative reclaimable_bytes bug was
the root cause here?

If you aren't able to reproduce but it is still happening on one of your
systems, we can try to instrument the periodic reclaim lifecycle with
bpftrace to catch calls to the various important functions setting it
reclaimable, etc.

Please let me know if I can assist you with that, or if you do have a
reproducer I could also look at.

Thanks,
Boris

> 
> Thanks,
> Sun YangKai

  reply	other threads:[~2025-12-30  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 18:58 [PATCH] btrfs: make periodic dynamic reclaim the default for data Boris Burkov
2025-07-16  6:24 ` Johannes Thumshirn
2025-07-16 15:56   ` Boris Burkov
2025-07-17 12:55     ` Johannes Thumshirn
2025-10-21 18:52 ` Chris Murphy
2025-10-21 22:39   ` Leo Martins
2025-10-22  0:37     ` Chris Murphy
2025-10-22  1:02       ` Boris Burkov
2025-10-23 23:27         ` Leo Martins
2025-12-13 22:09           ` Neal Gompa
2025-12-26  3:07 ` Sun Yangkai
2025-12-30  0:00   ` Boris Burkov [this message]
2025-12-30  1:29     ` Sun Yangkai
2025-12-30  1:41     ` Sun Yangkai

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=aVMWI7bVCZX4RAAa@devvm12410.ftw0.facebook.com \
    --to=boris@bur.io \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sunk67188@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