Dave Chinner 5672225e8f xfs: avoid unnecessary runtime sibling pointer endian conversions
Commit dc04db2aa7c9 has caused a small aim7 regression, showing a
small increase in CPU usage in __xfs_btree_check_sblock() as a
result of the extra checking.

This is likely due to the endian conversion of the sibling poitners
being unconditional instead of relying on the compiler to endian
convert the NULL pointer at compile time and avoiding the runtime
conversion for this common case.

Rework the checks so that endian conversion of the sibling pointers
is only done if they are not null as the original code did.

.... and these need to be "inline" because the compiler completely
fails to inline them automatically like it should be doing.

$ size fs/xfs/libxfs/xfs_btree.o*
   text	   data	    bss	    dec	    hex	filename
  51874	    240	      0	  52114	   cb92 fs/xfs/libxfs/xfs_btree.o.orig
  51562	    240	      0	  51802	   ca5a fs/xfs/libxfs/xfs_btree.o.inline

Just when you think the tools have advanced sufficiently we don't
have to care about stuff like this anymore, along comes a reminder
that *our tools still suck*.

Fixes: dc04db2aa7c9 ("xfs: detect self referencing btree sibling pointers")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2022-05-27 10:20:45 +10:00
..
2022-01-15 16:30:29 +02:00
2021-10-22 16:00:31 -07:00
2022-04-26 13:34:42 +10:00
2022-04-01 19:30:44 -07:00
2022-05-11 17:01:23 +10:00
2022-05-11 17:01:22 +10:00
2021-12-04 08:58:53 -08:00
2021-01-24 14:43:46 +01:00
2022-05-22 16:46:57 +10:00
2021-06-21 10:05:46 -07:00
2021-01-24 14:43:46 +01:00
2022-05-11 17:01:22 +10:00
2022-05-11 17:01:22 +10:00
2021-08-19 10:07:14 -07:00
2022-05-04 11:50:29 +10:00