Trust ARC_BUF_SHARED() more
commit6e41aca519322757f64cd737aebbcf36d931997f
authorAlexander Motin <mav@FreeBSD.org>
Fri, 20 Oct 2023 19:38:37 +0000 (20 15:38 -0400)
committerTony Hutter <hutter2@llnl.gov>
Tue, 7 Nov 2023 00:47:05 +0000 (6 16:47 -0800)
treeb7236a8c5dc614787a50dae1f7ded285565a1ca3
parent79f7de575252b62a2aa7c92f9cbef9710f1c244a
Trust ARC_BUF_SHARED() more

In my understanding ARC_BUF_SHARED() and arc_buf_is_shared() should
return identical results, except the second also asserts it deeper.
The first is much cheaper though, saving few pointer dereferences.
Replace production arc_buf_is_shared() calls with ARC_BUF_SHARED(),
and call arc_buf_is_shared() in random assertions, while making it
even more strict.

On my tests this in half reduces arc_buf_destroy_impl() time, that
noticeably reduces hash_lock congestion under heavy dbuf eviction.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15397
module/zfs/arc.c