mbox series

[0/4] Misc freespace cache cleanups

Message ID 20211123124422.5830-1-nborisov@suse.com (mailing list archive)
Headers show
Series Misc freespace cache cleanups | expand

Message

Nikolay Borisov Nov. 23, 2021, 12:44 p.m. UTC
Here's an assortment of freespace cache cleanups. 2 patches to consolidated some 
functions and 2 other to simplify/clarify arguments of called functions. This 
all results in a nice reduction of lines of code as well as code size: 

$./scripts/bloat-o-meter fs/btrfs/free-space-cache.o free-space-cache.patched
add/remove: 0/0 grow/shrink: 0/8 up/down: 0/-549 (-549)
Function                                     old     new   delta
__btrfs_add_free_space                      1124    1123      -1
btrfs_find_space_for_alloc                  1042    1039      -3
btrfs_remove_free_space                      648     644      -4
do_trimming                                  550     530     -20
btrfs_add_free_space                          75      55     -20
btrfs_add_free_space_async_trimmed            79      57     -22
try_merge_free_space                         602     505     -97
steal_from_bitmap                           1522    1140    -382
Total: Before=29299, After=28750, chg -1.87%


Nikolay Borisov (4):
  btrfs: consolidate bitmap_clear_bits/__bitmap_clear_bits
  btrfs: consolidate unlink_free_space/__unlink_free_space functions
  btrfs: make __btrfs_add_free_space take just block group reference
  btrfs: change name and type of private member of btrfs_free_space_ctl

 fs/btrfs/free-space-cache.c | 115 ++++++++++++++----------------------
 fs/btrfs/free-space-cache.h |   8 +--
 2 files changed, 48 insertions(+), 75 deletions(-)

Comments

David Sterba Nov. 23, 2021, 8:39 p.m. UTC | #1
On Tue, Nov 23, 2021 at 02:44:18PM +0200, Nikolay Borisov wrote:
> Here's an assortment of freespace cache cleanups. 2 patches to consolidated some 
> functions and 2 other to simplify/clarify arguments of called functions. This 
> all results in a nice reduction of lines of code as well as code size: 
> 
> $./scripts/bloat-o-meter fs/btrfs/free-space-cache.o free-space-cache.patched
> add/remove: 0/0 grow/shrink: 0/8 up/down: 0/-549 (-549)
> Function                                     old     new   delta
> __btrfs_add_free_space                      1124    1123      -1
> btrfs_find_space_for_alloc                  1042    1039      -3
> btrfs_remove_free_space                      648     644      -4
> do_trimming                                  550     530     -20
> btrfs_add_free_space                          75      55     -20
> btrfs_add_free_space_async_trimmed            79      57     -22
> try_merge_free_space                         602     505     -97
> steal_from_bitmap                           1522    1140    -382
> Total: Before=29299, After=28750, chg -1.87%
> 
> 
> Nikolay Borisov (4):
>   btrfs: consolidate bitmap_clear_bits/__bitmap_clear_bits
>   btrfs: consolidate unlink_free_space/__unlink_free_space functions
>   btrfs: make __btrfs_add_free_space take just block group reference
>   btrfs: change name and type of private member of btrfs_free_space_ctl

Added to misc-next, thanks.