Skip to content

xfs: 64kb directory block verification hurts

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3xfs: type verification is expensivefs/xfs/libxfs/xfs_types.c+9 -93 replies
2/3xfs: No need for inode number error injection in __xfs_dir3_data_checkfs/xfs/libxfs/xfs_dir2_data.c+1 -12 replies
3/3xfs: reduce debug overhead of dir leaf/node checksfs/xfs/libxfs/xfs_dir2_leaf.c fs/xfs/libxfs/xfs_dir2_node.c fs/xfs/libxfs/xfs_dir2_priv.h+10 -52 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDarrick J. WongChristoph Hellwig
1/3R-b
2/3R-b R-b
3/3R-b R-b

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/3] xfs: 64kb directory block verification hurts

Hi folks,

Quite simple: the debug code we have for internal directory block verification does not scale to large directory blocks. What is a minor nuisance at 4kB block size turns into a major problem at 64kB block size.

These three patches work to reduce the worst of this overhead without completely gutting the debug checks that are being done. The type verification code that is generated is horrible - the compiler does not inline all the nested 3 line functions and so the function call overhead is significant. Adding a few inline keywords so that the internal nesting is inlined cuts the overhead by 30%.

The overhead is still huge. Some of the verification testing is unnecessary - testing for error injection for a bad inode number millions of times a second is hugely expensive, and getting rid of that cuts overhead of directory inode number validation in half.

But the overhead is still huge. The biggest offender is the directory leaf hash ordering checks. On every debug check call, of which there is several for every directory modification, we walk the entire hash entry table in the buffer (8k entries!) to check for order. This is largely unnecessary, so only do this full order check when the check function is called from the IO verifiers. If a kernel dev needs more expensive checks to be re-instated, they only need to change a single parameter from false to true to do so.

These changes make scalability testing with 64kB directory blocks on debug kernels possible.

Cheers,

Dave.