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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2AA7C433FE for ; Wed, 13 Apr 2022 19:00:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58D276B0072; Wed, 13 Apr 2022 15:00:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53C6A6B0073; Wed, 13 Apr 2022 15:00:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DD4B6B0074; Wed, 13 Apr 2022 15:00:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 2E1BF6B0072 for ; Wed, 13 Apr 2022 15:00:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E3CF2258DD for ; Wed, 13 Apr 2022 19:00:25 +0000 (UTC) X-FDA: 79352771610.07.1D463DE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 3BA2F4000A for ; Wed, 13 Apr 2022 19:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649876424; 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=yyyEsPdvTZJVcklEDb+GWYLhg8rhPmGh+dm3Yjr2yg0=; b=dDlOthhdx0ZyFxhwq213vJo+wAKxgbsto3wBtmve/ZFVhKkGH+BCwfbZs8rSbzBpWBYnDF cY5nCxq1ueeDTM56Z1px0A4mNQiLzTlo6lENlkzmfMY/5urhTXbz2kcx89AVuFDye4jKvh GfP6y2hSbELb7+lquPQeKhpZED3uPt4= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-14-wlRrEvqhPuO0FsZgS6RlsA-1; Wed, 13 Apr 2022 15:00:23 -0400 X-MC-Unique: wlRrEvqhPuO0FsZgS6RlsA-1 Received: by mail-io1-f71.google.com with SMTP id q137-20020a6b8e8f000000b006495204b061so1656073iod.14 for ; Wed, 13 Apr 2022 12:00:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Is1dH8qBNj7/AA2D0zBglO4IcSn4onZ9K5hns2dUje4=; b=Q9N4nyCxNPApOhaPThm54pUTt0SvcH7YlCFZDCP2sAzvBkpWG09VQFExjaHtnszw4e x98l2O0GkPyR5gjsEA1Nddi68dUSsDYHZh13RD3po5xmOU056jj4gPuaU5ZPbIIJT/Mi MWYx0AQT9nKC9PkF6b3dyCPFZQT/yMW/OsSImr4AnwS0Hj2pyzaYBLuwFuAye7/OVXEf /bK4Qj8phVww2o99QbzGRJNgRmu3jbH7lkcbHHJe1FX48U8NnWtRhCdUcIRKxo2llp+G rS1dlsPEvIWoRtj8p/jLFr9uAooPXnctjZfOha6GEUIwqa2iNXrs6QMrezWW48j2y8CB /6Ig== X-Gm-Message-State: AOAM533Kog2YELKBzYL/tJKk3+eSUFyjCpErjfLU1yQOkJK/sGTg6zmK otDnCF2c6IFweL9ukZgq5uU3EdWZXaHGoAV0iSw4SIcS4kIIqwSYMBohAvL5e8oFKbrIpiPJGVO PItiKsNOyc2k= X-Received: by 2002:a05:6602:2e84:b0:646:2f68:f7a5 with SMTP id m4-20020a0566022e8400b006462f68f7a5mr17563896iow.34.1649876421413; Wed, 13 Apr 2022 12:00:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDngxqq9gj3UN3ARhh3DUZdkI0j6U2WYwFO84jU3i4Zn1n2H1hrQq+t4fAiNAaB9nqZFzT3g== X-Received: by 2002:a05:6602:2e84:b0:646:2f68:f7a5 with SMTP id m4-20020a0566022e8400b006462f68f7a5mr17563887iow.34.1649876421112; Wed, 13 Apr 2022 12:00:21 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id s6-20020a92cc06000000b002cbdc6c5c80sm400332ilp.36.2022.04.13.12.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 12:00:20 -0700 (PDT) Date: Wed, 13 Apr 2022 15:00:19 -0400 From: Peter Xu To: kernel test robot Cc: kbuild-all@lists.01.org, Linux Memory Management List , Mike Kravetz , Andrew Morton Subject: Re: [linux-next:master 3841/3955] mm/memory.c:1678:67: sparse: sparse: incorrect type in initializer (different base types) Message-ID: References: <202204140108.DeRAhWEn-lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <202204140108.DeRAhWEn-lkp@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="I5W67KG/KLt9KYq2" Content-Disposition: inline X-Rspam-User: X-Stat-Signature: wz8x6bko5cmtupn3irj3je5w4bfaz99c Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dDlOthhd; spf=none (imf01.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3BA2F4000A X-HE-Tag: 1649876425-325050 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: --I5W67KG/KLt9KYq2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Thu, Apr 14, 2022 at 01:16:26AM +0800, kernel test robot wrote: > 1664 if (start != end) { > 1665 if (unlikely(is_vm_hugetlb_page(vma))) { > 1666 /* > 1667 * It is undesirable to test vma->vm_file as it > 1668 * should be non-null for valid hugetlb area. > 1669 * However, vm_file will be NULL in the error > 1670 * cleanup path of mmap_region. When > 1671 * hugetlbfs ->mmap method fails, > 1672 * mmap_region() nullifies vma->vm_file > 1673 * before calling this function to clean up. > 1674 * Since no pte has actually been setup, it is > 1675 * safe to do nothing in this case. > 1676 */ > 1677 if (vma->vm_file) { > > 1678 unsigned long zap_flags = details ? > 1679 details->zap_flags : 0; The hugetlb side was overlooked after we re-typed zap_flags into bitmask.. One more patch (attached) needs to be squashed into patch "mm/hugetlb: Only drop uffd-wp special pte if required" to ease the sparse warning, sorry. -- Peter Xu --I5W67KG/KLt9KYq2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-fixup-mm-hugetlb-Only-drop-uffd-wp-special-pte-if-re.patch" >From ebb2908f24a7e2593c84406fe48afcc5923c68c7 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 13 Apr 2022 14:50:04 -0400 Subject: [PATCH] fixup! mm/hugetlb: Only drop uffd-wp special pte if required Signed-off-by: Peter Xu --- fs/hugetlbfs/inode.c | 2 +- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 6 +++--- mm/memory.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8b5b9df2be7d..c0bf65c70ade 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -405,7 +405,7 @@ static void remove_huge_page(struct page *page) static void hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end, - unsigned long zap_flags) + zap_flags_t zap_flags) { struct vm_area_struct *vma; diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6df51d23b7ee..3568dec16efb 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -145,11 +145,11 @@ long follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, int *); void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long, struct page *, - unsigned long); + zap_flags_t); void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, - struct page *ref_page, unsigned long zap_flags); + struct page *ref_page, zap_flags_t zap_flags); void hugetlb_report_meminfo(struct seq_file *); int hugetlb_report_node_meminfo(char *buf, int len, int nid); void hugetlb_show_meminfo(void); @@ -405,7 +405,7 @@ static inline unsigned long hugetlb_change_protection( static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { BUG(); } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e1571179698a..b07a4c6f16f3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4961,7 +4961,7 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma, static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, - struct page *ref_page, unsigned long zap_flags) + struct page *ref_page, zap_flags_t zap_flags) { struct mm_struct *mm = vma->vm_mm; unsigned long address; @@ -5095,7 +5095,7 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { __unmap_hugepage_range(tlb, vma, start, end, ref_page, zap_flags); @@ -5114,7 +5114,7 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb, void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { struct mmu_gather tlb; diff --git a/mm/memory.c b/mm/memory.c index 8e7f39c651c3..63644a7b5287 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1675,7 +1675,7 @@ static void unmap_single_vma(struct mmu_gather *tlb, * safe to do nothing in this case. */ if (vma->vm_file) { - unsigned long zap_flags = details ? + zap_flags_t zap_flags = details ? details->zap_flags : 0; i_mmap_lock_write(vma->vm_file->f_mapping); __unmap_hugepage_range_final(tlb, vma, start, end, -- 2.32.0 --I5W67KG/KLt9KYq2--