From 187f93137265feb2ea84f109168dffce2d91e7ef Mon Sep 17 00:00:00 2001 From: Brian Atkinson Date: Thu, 7 Nov 2024 14:11:05 -0500 Subject: [PATCH] Update ABD stats for linear page Linux a10e552 updated abd_free_linear_page() to no longer call abd_update_scatter_stat(). This meant that linear pages that were not attached to Direct I/O requests were not doing waste accounting for the ARC. This led to performance issues due to incorrect ARC accounting that resulted in 100% of CPU time being spent in arc_evict() during prolonged I/O workloads with the ARC. The call to abd_update_scatter_stats() is now conditionally called in abd_free_linear_page() when the ABD is not from a Direct I/O request. Reviewed-by: Mark Maybee Reviewed-by: Tony Nguyen Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Brian Atkinson Closes #16729 --- module/os/linux/zfs/abd_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/os/linux/zfs/abd_os.c b/module/os/linux/zfs/abd_os.c index 303af48cf..04ab8bbca 100644 --- a/module/os/linux/zfs/abd_os.c +++ b/module/os/linux/zfs/abd_os.c @@ -701,6 +701,8 @@ abd_free_linear_page(abd_t *abd) /* When backed by user page unmap it */ if (abd_is_from_pages(abd)) zfs_kunmap(sg_page(sg)); + else + abd_update_scatter_stats(abd, ABDSTAT_DECR); abd->abd_flags &= ~ABD_FLAG_LINEAR; abd->abd_flags &= ~ABD_FLAG_LINEAR_PAGE; -- 2.11.4.GIT