mbox series

[0/3] xfs: 64kb directory block verification hurts

Message ID 20210223054748.3292734-1-david@fromorbit.com (mailing list archive)
Headers show
Series xfs: 64kb directory block verification hurts | expand

Message

Dave Chinner Feb. 23, 2021, 5:47 a.m. UTC
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.