From 61c4c2b5e5d7d919149921d913322586ba5ebcab Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Thu, 29 Dec 2022 00:21:32 -0800 Subject: [PATCH] LU-16433 llite: check vvp_account_page_dirtied This patch removes duplicated codes from vvp_set_pagevec_dirty() and check vvp_account_page_dirtied to determine if falling back to call __set_page_dirty_nobuffers(). HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT also needs to be checked because vvp_account_page_dirtied is not defined if account_page_dirtied is exported. Test-Parameters: trivial clientdistro=el8.6 testlist=sanity Test-Parameters: trivial clientdistro=el8.7 testlist=sanity Test-Parameters: trivial clientdistro=el9.0 \ env=SANITY_EXCEPT="130 244a" testlist=sanity Test-Parameters: trivial clientdistro=sles15sp4 \ env=SANITY_EXCEPT="27J 101j 244a" testlist=sanity Change-Id: I272033d7494a157145224b1b8ce999a80958aa6c Fixes: 4bf090b811 ("LU-15959 kernel: new kernel [SLES15 SP4 5.14.21-150400.24.18.1]") Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49512 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Oleg Drokin Reviewed-by: Shuichi Ihara Reviewed-by: Yang Sheng --- lustre/llite/vvp_io.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 67066ec..dbb918a 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -1022,25 +1022,21 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec) "mapping must be set. page %p, page->private (cl_page) %p\n", page, (void *) page->private); -/* kernels without HAVE_KALLSYMS_LOOKUP_NAME also don't have account_dirty_page - * exported, and if we can't access that symbol, we can't do page dirtying in - * batch (taking the xarray lock only once) so we just fall back to a looped - * call to __set_page_dirty_nobuffers - */ -#ifndef HAVE_KALLSYMS_LOOKUP_NAME - for (i = 0; i < count; i++) - __set_page_dirty_nobuffers(pvec->pages[i]); -#else /* - * In kernel 5.14.21, kallsyms_lookup_name is defined but - * account_page_dirtied is not exported. + * kernels without HAVE_KALLSYMS_LOOKUP_NAME also don't have + * account_dirty_page exported, and if we can't access that symbol, + * we can't do page dirtying in batch (taking the xarray lock only once) + * so we just fall back to a looped call to __set_page_dirty_nobuffers */ +#ifndef HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT if (!vvp_account_page_dirtied) { for (i = 0; i < count; i++) __set_page_dirty_nobuffers(pvec->pages[i]); - goto end; + EXIT; } +#endif +#ifdef HAVE_KALLSYMS_LOOKUP_NAME for (i = 0; i < count; i++) { page = pvec->pages[i]; @@ -1090,7 +1086,6 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec) /* !PageAnon && !swapper_space */ __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); } -end: #endif EXIT; } -- 1.8.3.1