From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33A5FC433E0 for ; Thu, 4 Mar 2021 16:47:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9E7664F43 for ; Thu, 4 Mar 2021 16:47:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9E7664F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 437556B0012; Thu, 4 Mar 2021 11:47:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40E176B0023; Thu, 4 Mar 2021 11:47:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AF826B0024; Thu, 4 Mar 2021 11:47:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 124CE6B0012 for ; Thu, 4 Mar 2021 11:47:05 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BD6A7182C36F7 for ; Thu, 4 Mar 2021 16:47:04 +0000 (UTC) X-FDA: 77882771568.28.D59E96D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 926C82015DC6 for ; Thu, 4 Mar 2021 16:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614876419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZB1BYdhnS28mvVlHU1SQfHJ74JIHfhkk8EnsSzDlslM=; b=G3GVNHhzO+wnxhQfPz08B/vRtEAXOqd6o6y5JLD+64CESm5eIQGUPfE1BMEgEv4COmsIYS EDVUJQOuL+gFk6louiHgtj1DnbFfxtJgvtozWbcdzHUj87hF7hhg+oOt1K+aqyhZy6dnRr QslCFpPRMqxVRx04UfjGITSB9PcaAN8= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-M9KyqTZiO2S3Deborxph5Q-1; Thu, 04 Mar 2021 11:46:56 -0500 X-MC-Unique: M9KyqTZiO2S3Deborxph5Q-1 Received: by mail-qk1-f199.google.com with SMTP id g18so13372095qki.15 for ; Thu, 04 Mar 2021 08:46:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZB1BYdhnS28mvVlHU1SQfHJ74JIHfhkk8EnsSzDlslM=; b=DjXmmPnZPxsJGT2+x+maO6G88Kx6N8WJ9ma3mAlqDD/C7dkr8ZAG7ksQ3zzwpdpuUe 05EIoxp111eEczUHTsuQzDfoT+N5VMZ7oO8VNS7Inaa0yTM8bwjlFmw+CZxCLLSlDZgU 8LZpDRxzo7G6wCr/vaB8DnrxIGkvjZed7LOAik85XRf4vkfhIYEurxgrYwI3es8m6sQ+ sAquuMG6R7mZPhaKFxdNjsXgpK0f38obI7QZcaLyTXcAr6Labau3y0Xpv43cWSTHJSG7 ClcRlQLnmNuCz+JP/M5pQzXV4JXzaAgC2LZWqP4OK0xHcroeoVkCFWkjgFddNx56426x b6yQ== X-Gm-Message-State: AOAM531FMYwWvbtE5S65pb/fctG0VtgWt0B/gQ2s7LwfjNlDooJU9ciK mCcRwUPCxrTIaMWs0vl7IVl0X1UiYstFdXH0dTRpkK5HNHHcG01nyjwqhAVJvUkwJuKMyUSYWyD xoi8iTTVtkaE= X-Received: by 2002:ac8:1209:: with SMTP id x9mr4114052qti.89.1614876416132; Thu, 04 Mar 2021 08:46:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYkIsLzg6JUUcyZVUmA4NY4lPA+155G5Kne2Lt5u80pP60k8ZWh3uE4h4ro2+NZCPvyt/Low== X-Received: by 2002:ac8:1209:: with SMTP id x9mr4114023qti.89.1614876415803; Thu, 04 Mar 2021 08:46:55 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-25-174-95-95-253.dsl.bell.ca. [174.95.95.253]) by smtp.gmail.com with ESMTPSA id e15sm51099qtp.58.2021.03.04.08.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 08:46:54 -0800 (PST) Date: Thu, 4 Mar 2021 11:46:53 -0500 From: Peter Xu To: kernel test robot , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Axel Rasmussen , "Kirill A . Shutemov" , Mike Rapoport , Mike Kravetz , Andrea Arcangeli Subject: Re: [PATCH v4 1/4] hugetlb: Pass vma into huge_pte_alloc() and huge_pmd_share() Message-ID: <20210304164653.GB397383@xz-x1> References: <20210218230633.15028-2-peterx@redhat.com> <202103050012.xQIxbA9h-lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <202103050012.xQIxbA9h-lkp@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: 8p8b7efyqw7dempe8j5633jgquf4ok8x X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 926C82015DC6 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614876420-30238 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > > 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