Hi Andrea, [auto build test WARNING on v4.5-rc5] [also build test WARNING on next-20160223] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Andrea-Arcangeli/mm-thp-fix-SMP-race-condition-between-THP-page-fault/20160224-020835 config: x86_64-randconfig-x011-201608 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c: In function '__handle_mm_fault': mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ >> include/linux/compiler.h:123:14: note: in expansion of macro 'likely_notrace' ______r = likely_notrace(x); \ ^ include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:147:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ >> include/linux/compiler.h:123:14: note: in expansion of macro 'likely_notrace' ______r = likely_notrace(x); \ ^ include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:158:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:158:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from include/linux/kernel_stat.h:4, from mm/memory.c:41: mm/memory.c:3419:34: error: incompatible type for argument 1 of 'pmd_trans_unstable' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ include/linux/compiler.h:158:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^ >> mm/memory.c:3419:2: note: in expansion of macro 'if' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ >> include/linux/compiler.h:123:14: note: in expansion of macro 'likely_notrace' ______r = likely_notrace(x); \ ^ include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ mm/memory.c:3419:6: note: in expansion of macro 'unlikely' if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) ^ In file included from arch/x86/include/asm/pgtable.h:914:0, from include/linux/mm.h:67, from mm/memory.c:42: include/asm-generic/pgtable.h:731:19: note: expected 'pmd_t * {aka struct <anonymous> *}' but argument is of type 'pmd_t {aka struct <anonymous>}' static inline int pmd_trans_unstable(pmd_t *pmd) ^ vim +/if +3419 mm/memory.c 3403 */ 3404 if (unlikely(pmd_none(*pmd)) && 3405 unlikely(__pte_alloc(mm, vma, pmd, address))) 3406 return VM_FAULT_OOM; 3407 /* 3408 * If an huge pmd materialized from under us just retry later. 3409 * Use pmd_trans_unstable() instead of pmd_trans_huge() to 3410 * ensure the pmd didn't become pmd_trans_huge from under us 3411 * and then immediately back to pmd_none as result of 3412 * MADV_DONTNEED running immediately after a huge_pmd fault of 3413 * a different thread of this mm, in turn leading to a false 3414 * negative pmd_trans_huge() retval. All we have to ensure is 3415 * that it is a regular pmd that we can walk with 3416 * pte_offset_map() and we can do that through an atomic read 3417 * in C, which is what pmd_trans_unstable() is provided for. 3418 */ > 3419 if (unlikely(pmd_trans_unstable(*pmd) || pmd_devmap(*pmd))) 3420 return 0; 3421 /* 3422 * A regular pmd is established and it can't morph into a huge pmd 3423 * from under us anymore at this point because we hold the mmap_sem 3424 * read mode and khugepaged takes it in write mode. So now it's 3425 * safe to run pte_offset_map(). 3426 */ 3427 pte = pte_offset_map(pmd, address); --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data