Whamcloud - gitweb
LU-12904 build: account_page_dirtied is not exported 75/36575/4
authorShaun Tancheff <stancheff@cray.com>
Fri, 25 Oct 2019 20:11:37 +0000 (15:11 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Dec 2019 03:26:51 +0000 (03:26 +0000)
Linux 5.2 does not export account_page_dirtied
mm: remove the account_page_dirtied export

Use symbol_get() to access account_page_dirtied for Lustre

kernel-commit: ac1c3e49a9a734150b33297eeca5b43d92fd5be8

Test-Parameters: trivial
Cray-bug-id: LUS-8042
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: I9cd432556e183d06784537b000a4bda657116d88
Reviewed-on: https://review.whamcloud.com/36575
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/llite/vvp_io.c

index 3bb9411..ab9bbae 100644 (file)
@@ -2879,6 +2879,23 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_HAS_LINUX_SELINUX_ENABLED
 
 #
+# LC_ACCOUNT_PAGE_DIRTIED
+#
+# After 5.2 kernel page dirtied is not exported
+#
+AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
+LB_CHECK_COMPILE([if 'account_page_dirtied' is exported],
+account_page_dirtied, [
+       #include <linux/mm.h>
+],[
+       account_page_dirtied(NULL, NULL);
+],[
+       AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED, 1,
+               [account_page_dirtied is available])
+])
+]) # LC_ACCOUNT_PAGE_DIRTIED
+
+#
 # LC_BIO_BI_PHYS_SEGMENTS
 #
 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
@@ -3152,6 +3169,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 5.1
        LC_HAS_LINUX_SELINUX_ENABLED
 
+       # 5.2
+       LC_ACCOUNT_PAGE_DIRTIED
+
        # 5.3
        LC_BIO_BI_PHYS_SEGMENTS
        LC_LM_COMPARE_OWNER_EXISTS
index c68d809..9ae162f 100644 (file)
@@ -920,6 +920,7 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io,
 
 /*
  * Kernels 4.2 - 4.5 pass memcg argument to account_page_dirtied()
+ * Kernel v5.2-5678-gac1c3e4 no longer exports account_page_dirtied 
  */
 static inline void ll_account_page_dirtied(struct page *page,
                                           struct address_space *mapping)
@@ -929,8 +930,19 @@ static inline void ll_account_page_dirtied(struct page *page,
 
        account_page_dirtied(page, mapping, memcg);
        mem_cgroup_end_page_stat(memcg);
+#elif defined HAVE_ACCOUNT_PAGE_DIRTIED
+       account_page_dirtied(page, mapping, memcg);
 #else
-       account_page_dirtied(page, mapping);
+       typedef unsigned int (dirtied_t)(struct page *pg,
+                                        struct address_space *as);
+       const char *symbol = "account_page_dirtied";
+       static dirtied_t *dirtied = NULL;
+
+       if (!dirtied)
+               dirtied = (dirtied_t *)symbol_get(symbol);
+
+       if (dirtied)
+               dirtied(page, mapping);
 #endif
 }