mbox series

[v2,0/2] btrfs: minor reclaim tuning

Message ID cover.1665701210.git.boris@bur.io (mailing list archive)
Headers show
Series btrfs: minor reclaim tuning | expand

Message

Boris Burkov Oct. 13, 2022, 10:52 p.m. UTC
Two minor reclaim fixes that reduce relocations when they aren't quite
necessary. These are a basic first step in a broader effort to reduce
the alarmingly high rate of relocation we have observed in production
at Meta.

The first patch skips empty relocation.

The second patch skips relocation that no longer passes the reclaim
threshold check at reclaim time.

Changes in v2:
- added the re-check patch
- improved commit message and comment in the skip-empty patch.

Boris Burkov (2):
  btrfs: skip reclaim if block_group is empty
  btrfs: re-check reclaim condition in reclaim worker

 fs/btrfs/block-group.c | 83 +++++++++++++++++++++++++++++-------------
 1 file changed, 58 insertions(+), 25 deletions(-)

Comments

Filipe Manana Oct. 14, 2022, 10:24 a.m. UTC | #1
On Thu, Oct 13, 2022 at 11:52 PM Boris Burkov <boris@bur.io> wrote:
>
> Two minor reclaim fixes that reduce relocations when they aren't quite
> necessary. These are a basic first step in a broader effort to reduce
> the alarmingly high rate of relocation we have observed in production
> at Meta.
>
> The first patch skips empty relocation.
>
> The second patch skips relocation that no longer passes the reclaim
> threshold check at reclaim time.
>
> Changes in v2:
> - added the re-check patch
> - improved commit message and comment in the skip-empty patch.
>
> Boris Burkov (2):
>   btrfs: skip reclaim if block_group is empty
>   btrfs: re-check reclaim condition in reclaim worker

Makes sense and both patches look good to me, so:

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Thanks.

>
>  fs/btrfs/block-group.c | 83 +++++++++++++++++++++++++++++-------------
>  1 file changed, 58 insertions(+), 25 deletions(-)
>
> --
> 2.38.0
>
David Sterba Oct. 14, 2022, 2:09 p.m. UTC | #2
On Thu, Oct 13, 2022 at 03:52:08PM -0700, Boris Burkov wrote:
> Two minor reclaim fixes that reduce relocations when they aren't quite
> necessary. These are a basic first step in a broader effort to reduce
> the alarmingly high rate of relocation we have observed in production
> at Meta.
> 
> The first patch skips empty relocation.
> 
> The second patch skips relocation that no longer passes the reclaim
> threshold check at reclaim time.
> 
> Changes in v2:
> - added the re-check patch
> - improved commit message and comment in the skip-empty patch.
> 
> Boris Burkov (2):
>   btrfs: skip reclaim if block_group is empty
>   btrfs: re-check reclaim condition in reclaim worker

Added to misc-next, thanks.