Re: [PATCH v3 07/15] mm/pte_ref: add support for user PTE page table page allocation

From: kernel test robot
Date: Thu Nov 11 2021 - 10:17:59 EST


Hi Qi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hnaz-mm/master]
[also build test ERROR on linus/master next-20211111]
[cannot apply to tip/perf/core tip/x86/core v5.15]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Qi-Zheng/Free-user-PTE-page-table-pages/20211110-185837
base: https://github.com/hnaz/linux-mm master
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/6e3cc5bb722cbd2fc4170d2f5371e52792d17d2e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qi-Zheng/Free-user-PTE-page-table-pages/20211110-185837
git checkout 6e3cc5bb722cbd2fc4170d2f5371e52792d17d2e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from arch/ia64/include/uapi/asm/gcc_intrin.h:11,
from arch/ia64/include/asm/gcc_intrin.h:10,
from arch/ia64/include/uapi/asm/intrinsics.h:20,
from arch/ia64/include/asm/intrinsics.h:11,
from arch/ia64/include/asm/page.h:11,
from arch/ia64/include/asm/pgtable.h:18,
from include/linux/pgtable.h:6,
from include/linux/pte_ref.h:10,
from mm/pte_ref.c:8:
mm/pte_ref.c: In function 'pte_try_get':
>> mm/pte_ref.c:37:22: error: implicit declaration of function 'is_huge_pmd'; did you mean 'zap_huge_pmd'? [-Werror=implicit-function-declaration]
37 | if (unlikely(is_huge_pmd(*pmd)))
| ^~~~~~~~~~~
include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
cc1: some warnings being treated as errors


vim +37 mm/pte_ref.c

e03404013f81d7 Qi Zheng 2021-11-10 20
e03404013f81d7 Qi Zheng 2021-11-10 21 /*
e03404013f81d7 Qi Zheng 2021-11-10 22 * pte_try_get - Try to increment refcount for the PTE page table.
e03404013f81d7 Qi Zheng 2021-11-10 23 * @pmd: a pointer to the pmd entry corresponding to the PTE page table.
e03404013f81d7 Qi Zheng 2021-11-10 24 *
e03404013f81d7 Qi Zheng 2021-11-10 25 * Return true if the increment succeeded. Otherwise return false.
e03404013f81d7 Qi Zheng 2021-11-10 26 *
e03404013f81d7 Qi Zheng 2021-11-10 27 * Before Operating the PTE page table, we need to hold a refcount
e03404013f81d7 Qi Zheng 2021-11-10 28 * to protect against the concurrent release of the PTE page table.
e03404013f81d7 Qi Zheng 2021-11-10 29 * But we will fail in the following case:
e03404013f81d7 Qi Zheng 2021-11-10 30 * - The content mapped in @pmd is not a PTE page
e03404013f81d7 Qi Zheng 2021-11-10 31 * - The refcount of the PTE page table is zero, it will be freed
e03404013f81d7 Qi Zheng 2021-11-10 32 */
e03404013f81d7 Qi Zheng 2021-11-10 33 enum pte_tryget_type pte_try_get(pmd_t *pmd)
e03404013f81d7 Qi Zheng 2021-11-10 34 {
e03404013f81d7 Qi Zheng 2021-11-10 35 if (unlikely(pmd_none(*pmd)))
e03404013f81d7 Qi Zheng 2021-11-10 36 return TRYGET_FAILED_NONE;
e03404013f81d7 Qi Zheng 2021-11-10 @37 if (unlikely(is_huge_pmd(*pmd)))
e03404013f81d7 Qi Zheng 2021-11-10 38 return TRYGET_FAILED_HUGE_PMD;
e03404013f81d7 Qi Zheng 2021-11-10 39
e03404013f81d7 Qi Zheng 2021-11-10 40 return TRYGET_SUCCESSED;
e03404013f81d7 Qi Zheng 2021-11-10 41 }
e03404013f81d7 Qi Zheng 2021-11-10 42

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip