Skip to content

Set/get accessor speedups

David Sterba linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7btrfs: accessors: simplify folio bounds checksfs/btrfs/accessors.c+2 -20 replies
2/7btrfs: accessors: use type sizeof constants directlyfs/btrfs/accessors.c+6 -103 replies
3/7btrfs: accessors: inline eb bounds check and factor out the error reportfs/btrfs/accessors.c+15 -142 replies
4/7btrfs: accessors: compile-time fast path for u8fs/btrfs/accessors.c+3 -20 replies
5/7btrfs: accessors: compile-time fast path for u16fs/btrfs/accessors.c+18 -70 replies
6/7btrfs: accessors: set target address at initializationfs/btrfs/accessors.c+8 -80 replies
7/7btrfs: accessors: factor out split memcpy with two sourcesfs/btrfs/accessors.c+12 -32 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBoris Burkov
SeriesR-b
1/7
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] Set/get accessor speedups

Followup to [1] bringing refactoring that allows compiler to do more optimizations and stack usage reduction. As the set/get helpers are heavily used in many functions this improves performance. I will provide some numbers later as I've done mostly functional tests. During the development I've identified a few more possible optimizations to improve performance, but this series is OK as is.

Overall effects of this series:

Stack:
  btrfs_set_16                                          -72 (88 -> 16)
  btrfs_get_32                                          -56 (80 -> 24)
  btrfs_set_8                                           -72 (88 -> 16)
  btrfs_set_64                                          -64 (88 -> 24)
  btrfs_get_8                                           -72 (80 -> 8)
  btrfs_get_16                                          -64 (80 -> 16)
  btrfs_set_32                                          -64 (88 -> 24)
  btrfs_get_64                                          -56 (80 -> 24)

NEW (48):
report_setget_bounds 48
LOST/NEW DELTA: +48
PRE/POST DELTA: -472

Code:

text data bss dec hex filename

  1456601  115665   16088 1588354  183c82 pre/btrfs.ko
  1454229  115665   16088 1585982  18333e post/btrfs.ko

DELTA: -2372

[1] https://lore.kernel.org/linux-btrfs/[email protected]/

David Sterba (7):
btrfs: accessors: simplify folio bounds checks
btrfs: accessors: use type sizeof constants directly
btrfs: accessors: inline eb bounds check and factor out the error
report
btrfs: accessors: compile-time fast path for u8
btrfs: accessors: compile-time fast path for u16
btrfs: accessors: set target address at initialization
btrfs: accessors: factor out split memcpy with two sources

 fs/btrfs/accessors.c | 84 +++++++++++++++++++++++++++-----------------
 1 file changed, 51 insertions(+), 33 deletions(-)
Signature · 1 line
2.49.0