All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: kernel test robot <lkp@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH v4 1/4] hugetlb: Pass vma into huge_pte_alloc() and huge_pmd_share()
Date: Thu, 4 Mar 2021 11:46:53 -0500	[thread overview]
Message-ID: <20210304164653.GB397383@xz-x1> (raw)
In-Reply-To: <202103050012.xQIxbA9h-lkp@intel.com>

On Fri, Mar 05, 2021 at 12:31:00AM +0800, kernel test robot wrote:
> Hi Peter,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on arm64/for-next/core]
> [also build test ERROR on linux/master linus/master v5.12-rc1 next-20210304]
> [cannot apply to hnaz-linux-mm/master]
> [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/Peter-Xu/hugetlb-Disable-huge-pmd-unshare-for-uffd-wp/20210219-071334
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
> config: mips-randconfig-m031-20210304 (attached as .config)
> compiler: mipsel-linux-gcc (GCC) 9.3.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/7ede06d6f63e59db4b9dee54f78eeac0c9ca17e4
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Peter-Xu/hugetlb-Disable-huge-pmd-unshare-for-uffd-wp/20210219-071334
>         git checkout 7ede06d6f63e59db4b9dee54f78eeac0c9ca17e4
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
> >> mm/hugetlb.c:5376:8: error: conflicting types for 'huge_pmd_share'
>     5376 | pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct vma,
>          |        ^~~~~~~~~~~~~~
>    In file included from mm/hugetlb.c:39:
>    include/linux/hugetlb.h:155:8: note: previous declaration of 'huge_pmd_share' was here
>      155 | pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
>          |        ^~~~~~~~~~~~~~
> 
> 
> vim +/huge_pmd_share +5376 mm/hugetlb.c
> 
>   5343	
>   5344	/*
>   5345	 * unmap huge page backed by shared pte.
>   5346	 *
>   5347	 * Hugetlb pte page is ref counted at the time of mapping.  If pte is shared
>   5348	 * indicated by page_count > 1, unmap is achieved by clearing pud and
>   5349	 * decrementing the ref count. If count == 1, the pte page is not shared.
>   5350	 *
>   5351	 * Called with page table lock held and i_mmap_rwsem held in write mode.
>   5352	 *
>   5353	 * returns: 1 successfully unmapped a shared pte page
>   5354	 *	    0 the underlying pte page is not shared, or it is the last user
>   5355	 */
>   5356	int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
>   5357						unsigned long *addr, pte_t *ptep)
>   5358	{
>   5359		pgd_t *pgd = pgd_offset(mm, *addr);
>   5360		p4d_t *p4d = p4d_offset(pgd, *addr);
>   5361		pud_t *pud = pud_offset(p4d, *addr);
>   5362	
>   5363		i_mmap_assert_write_locked(vma->vm_file->f_mapping);
>   5364		BUG_ON(page_count(virt_to_page(ptep)) == 0);
>   5365		if (page_count(virt_to_page(ptep)) == 1)
>   5366			return 0;
>   5367	
>   5368		pud_clear(pud);
>   5369		put_page(virt_to_page(ptep));
>   5370		mm_dec_nr_pmds(mm);
>   5371		*addr = ALIGN(*addr, HPAGE_SIZE * PTRS_PER_PTE) - HPAGE_SIZE;
>   5372		return 1;
>   5373	}
>   5374	#define want_pmd_share()	(1)
>   5375	#else /* !CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
> > 5376	pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct vma,
>   5377			      unsigned long addr, pud_t *pud)
>   5378	{
>   5379		return NULL;
>   5380	}
>   5381	

Sorry for this!  I think we need to squash below into this patch for
!CONFIG_ARCH_WANT_HUGE_PMD_SHARE:

-----8<-----
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index fc62932c31cb..94ac419f88cd 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5415,7 +5415,7 @@ int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
 }
 
 #else /* !CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
-pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct vma,
+pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
                      unsigned long addr, pud_t *pud)
 {
        return NULL;
-----8<-----

Andrew, please kindly let me know when a repost is needed.

Thanks,

-- 
Peter Xu


  reply	other threads:[~2021-03-04 16:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 23:06 [PATCH v4 0/4] hugetlb: Disable huge pmd unshare for uffd-wp Peter Xu
2021-02-18 23:06 ` [PATCH v4 1/4] hugetlb: Pass vma into huge_pte_alloc() and huge_pmd_share() Peter Xu
2021-03-04 16:31   ` kernel test robot
2021-03-04 16:46     ` Peter Xu [this message]
2021-02-18 23:12 ` [PATCH v4 2/4] hugetlb/userfaultfd: Forbid huge pmd sharing when uffd enabled Peter Xu
2021-03-10  7:48   ` Naresh Kamboju
2021-03-10  7:48     ` Naresh Kamboju
2021-03-10 16:57     ` Peter Xu
2021-03-10 18:09       ` Naresh Kamboju
2021-03-10 18:09         ` Naresh Kamboju
2021-02-18 23:12 ` [PATCH v4 3/4] mm/hugetlb: Move flush_hugetlb_tlb_range() into hugetlb.h Peter Xu
2021-02-18 23:12 ` [PATCH v4 4/4] hugetlb/userfaultfd: Unshare all pmds for hugetlbfs when register wp Peter Xu
2021-03-01 14:20 ` [PATCH v4 0/4] hugetlb: Disable huge pmd unshare for uffd-wp Peter Xu

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=20210304164653.GB397383@xz-x1 \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mike.kravetz@oracle.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.