linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: kbuild-all@01.org, "Kirill A. Shutemov" <kirill@shutemov.name>,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/1] mm: thp: fix SMP race condition between THP page fault
Date: Wed, 24 Feb 2016 02:27:34 +0800	[thread overview]
Message-ID: <201602240255.PTCr4IOx%fengguang.wu@intel.com> (raw)
In-Reply-To: <20160223180609.GC23289@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 5996 bytes --]

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-x012-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:137:45: note: in definition of macro 'unlikely'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                ^
   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:137:53: note: in definition of macro 'unlikely'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                        ^
   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:110:47: note: in definition of macro 'likely_notrace'
    #define likely_notrace(x) __builtin_expect(!!(x), 1)
                                                  ^
   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 +/unlikely +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 #2: .config.gz --]
[-- Type: application/octet-stream, Size: 21966 bytes --]

  parent reply	other threads:[~2016-02-23 18:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 15:49 THP race? Kirill A. Shutemov
2016-02-23 18:06 ` Andrea Arcangeli
2016-02-23 18:18   ` [PATCH 1/1] mm: thp: fix SMP race condition between THP page fault kbuild test robot
2016-02-23 18:21   ` kbuild test robot
2016-02-23 18:27   ` kbuild test robot [this message]
2016-02-23 18:38   ` THP race? Kirill A. Shutemov
2016-02-23 19:28     ` Andrea Arcangeli
2016-02-25 18:45       ` Dan Williams
2016-02-26 10:37         ` Kirill A. Shutemov
2016-02-26 14:46           ` Dan Williams
2016-02-23 18:49 ` [PATCH 0/1] " Andrea Arcangeli
2016-02-23 18:49   ` [PATCH 1/1] mm: thp: fix SMP race condition between THP page fault and MADV_DONTNEED Andrea Arcangeli
2016-02-23 21:18     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201602240255.PTCr4IOx%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=aarcange@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox