Dave Chinner 39d3c0b596 xfs: No need for inode number error injection in __xfs_dir3_data_check
We call xfs_dir_ino_validate() for every dir entry in a directory
when doing validity checking of the directory. It calls
xfs_verify_dir_ino() then emits a corruption report if bad or does
error injection if good. It is extremely costly:

  43.27%  [kernel]  [k] xfs_dir3_leaf_check_int
  10.28%  [kernel]  [k] __xfs_dir3_data_check
   6.61%  [kernel]  [k] xfs_verify_dir_ino
   4.16%  [kernel]  [k] xfs_errortag_test
   4.00%  [kernel]  [k] memcpy
   3.48%  [kernel]  [k] xfs_dir_ino_validate

7% of the cpu usage in this directory traversal workload is
xfs_dir_ino_validate() doing absolutely nothing.

We don't need error injection to simulate a bad inode numbers in the
directory structure because we can do that by fuzzing the structure
on disk.

And we don't need a corruption report, because the
__xfs_dir3_data_check() will emit one if the inode number is bad.

So just call xfs_verify_dir_ino() directly here, and get rid of all
this unnecessary overhead:

  40.30%  [kernel]  [k] xfs_dir3_leaf_check_int
  10.98%  [kernel]  [k] __xfs_dir3_data_check
   8.10%  [kernel]  [k] xfs_verify_dir_ino
   4.42%  [kernel]  [k] memcpy
   2.22%  [kernel]  [k] xfs_dir2_data_get_ftype
   1.52%  [kernel]  [k] do_raw_spin_lock

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: Darrick J. Wong <djwong@kernel.org>
2021-03-25 16:47:51 -07:00
..
2020-09-06 18:05:51 -07:00
2020-09-15 20:52:41 -07:00
2021-01-24 14:43:46 +01:00
2021-01-24 14:27:20 +01:00
2021-02-26 15:49:51 -07:00
2021-02-26 15:49:51 -07:00
2020-03-11 09:11:39 -07:00
2021-02-23 13:39:45 -08:00
2021-03-25 16:47:50 -07:00
2021-02-23 13:39:45 -08:00
2021-02-21 10:34:36 -08:00
2021-01-24 14:43:46 +01:00
2021-01-24 14:43:46 +01:00
2021-02-10 17:28:13 -08:00
2021-03-25 16:47:50 -07:00
2020-12-16 16:07:34 -08:00
2021-01-24 14:43:46 +01:00
2021-02-21 10:34:36 -08:00
2020-12-16 16:07:34 -08:00