Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1059939pxb; Wed, 6 Apr 2022 07:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFDNlRHZ5V8Cj92Fn+DMGhSMXliEMWkTjbx4qXfUtsfwYdlTDy4Ujtd+qRYvPlZs76SJSQ X-Received: by 2002:a17:902:714d:b0:156:6f38:3323 with SMTP id u13-20020a170902714d00b001566f383323mr8921523plm.173.1649256513120; Wed, 06 Apr 2022 07:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649256513; cv=none; d=google.com; s=arc-20160816; b=fv1zKkgo5sjgvA7devbvLHnIl7e9WeAy4FtDGHXji4uKFacSeY7v+FJLBmUnnCazZ8 55LWzAUHuhnWkrubo58SwrkorDtk6rb7Bt8ojJCFYUvSPvCNnK8O/rHZ6rPUwBfaS8vr +Rz7uN8O354AolzHiYlc8lkQlWn7bYnRQJzh74A/TF44W6botU7lvfKmtROSGg9s6X4+ 2f6/MCorOuEJusnVN1DRj3mCRiQ3SzK35Rhk6eoDq7CsRiCCsWjWw8B5EaRhdI7g1LcI y35ENhX9IQ13yrFb41PjqUXe77vHCRWpfc0F3Tm8ktqoHsNPGOFrrQ4iis+71B02ZcAw oQlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vJFZDmK8jkd9TKtKlyaEGzzCp92Q3Jlwvq3iTSfGJpk=; b=urPk1A42QZ4oXnq6AEzhIWeb0MQAaUI2sVK0Nn4Bambb4DFsthGVe0KZ0FlPM6r1f9 gYvx1SQkNS13nqN48ccGSn2HWqEBcpOUkizMyugL5AGR+tmKlKLd2cqOLRgIc1Pm9Aen aqW9uYYGUIGrlGfMRWvXBrXyn13RvIOmrNXtryTTkIvAvR4uWD9pjVemgsyq+PZHQdmF cMuOujxSB9i8htbBpB2M4VXSSvO2n2AcV2/ASOToR5LHvBgLjR4GHgHqbGjspgy66JRP fpdpL5hppzHjZ+glNvdco5xK36FT1eyesgLxjpW97yBtxPREXCjKovSg/Z2BC6u5XQOz 5dyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DGf9OXtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g7-20020a056a001a0700b004fa3a8dff5bsi16552726pfv.18.2022.04.06.07.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DGf9OXtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03A3A682589; Wed, 6 Apr 2022 05:38:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441800AbiDFJhj (ORCPT + 99 others); Wed, 6 Apr 2022 05:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452377AbiDFJeq (ORCPT ); Wed, 6 Apr 2022 05:34:46 -0400 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F9F5141D8D for ; Tue, 5 Apr 2022 23:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649225875; x=1680761875; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Naa24ktxw2UZOhiet3D4DF5IbUq9hEaWxUtScFptzPY=; b=DGf9OXtxc/WxSGEdS6xLhbotf65nT+15UVcRc04kMWUZl61DABDhXI1g zHBahDf8ObS5bPUpxWJf84Epon17Yy35jkeg+ZYi2fP2Xmk/LQkB0qddW NzuxPpz1NVNpsT5R2/0y5hxaI87eJAWqwytv55ZV32t8MdyB2pIy6BXLP mD9yosuss3HXY6VBthCh+HqaXnEoSAtcmmjDsRtH3Gnyq0MSkYK2blbD7 cuzofn1JjJPDmy1bopjbCK4+tKRgIGW3DjE0TzdtCtWVfawdKSOgBqBkH 9NnVx4B/QUUvE3Ur9AhDJBJYoXuQhDJeC8KQx1GQMO5H73U7CmfTp9eW9 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10308"; a="321657139" X-IronPort-AV: E=Sophos;i="5.90,239,1643702400"; d="scan'208";a="321657139" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2022 23:17:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,239,1643702400"; d="scan'208";a="505601654" Received: from lkp-server02.sh.intel.com (HELO a44fdfb70b94) ([10.239.97.151]) by orsmga003.jf.intel.com with ESMTP; 05 Apr 2022 23:17:50 -0700 Received: from kbuild by a44fdfb70b94 with local (Exim 4.95) (envelope-from ) id 1nbyzF-00048D-V8; Wed, 06 Apr 2022 06:17:49 +0000 Date: Wed, 6 Apr 2022 14:16:56 +0800 From: kernel test robot To: Peter Xu , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: kbuild-all@lists.01.org, Mike Kravetz , Nadav Amit , Matthew Wilcox , Mike Rapoport , David Hildenbrand , Hugh Dickins , Jerome Glisse , "Kirill A . Shutemov" , Andrea Arcangeli , Andrew Morton , Linux Memory Management List , Axel Rasmussen , Alistair Popple , peterx@redhat.com Subject: Re: [PATCH v8 10/23] mm/shmem: Handle uffd-wp during fork() Message-ID: <202204061453.OXOxSh6e-lkp@intel.com> References: <20220405014855.14468-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405014855.14468-1-peterx@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on hnaz-mm/master] [cannot apply to arnd-asm-generic/master linus/master linux/master v5.18-rc1 next-20220405] [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/intel-lab-lkp/linux/commits/Peter-Xu/userfaultfd-wp-Support-shmem-and-hugetlbfs/20220405-100136 base: https://github.com/hnaz/linux-mm master config: ia64-buildonly-randconfig-r005-20220405 (https://download.01.org/0day-ci/archive/20220406/202204061453.OXOxSh6e-lkp@intel.com/config) compiler: ia64-linux-gcc (GCC) 11.2.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/intel-lab-lkp/linux/commit/49e56558a1f453907d2813e1ba94d91f9d102e73 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Peter-Xu/userfaultfd-wp-Support-shmem-and-hugetlbfs/20220405-100136 git checkout 49e56558a1f453907d2813e1ba94d91f9d102e73 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from arch/ia64/include/asm/pgtable.h:153, from include/linux/pgtable.h:6, from arch/ia64/include/asm/uaccess.h:40, from include/linux/uaccess.h:11, from arch/ia64/include/asm/sections.h:11, from include/linux/interrupt.h:21, from include/linux/kernel_stat.h:9, from mm/memory.c:42: arch/ia64/include/asm/mmu_context.h: In function 'reload_context': arch/ia64/include/asm/mmu_context.h:127:48: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable] 127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4; | ^~~~~~~ In file included from include/linux/mm_inline.h:9, from mm/memory.c:44: include/linux/userfaultfd_k.h: In function 'pte_marker_entry_uffd_wp': include/linux/userfaultfd_k.h:260:16: error: implicit declaration of function 'is_pte_marker_entry' [-Werror=implicit-function-declaration] 260 | return is_pte_marker_entry(entry) && | ^~~~~~~~~~~~~~~~~~~ include/linux/userfaultfd_k.h:261:14: error: implicit declaration of function 'pte_marker_get' [-Werror=implicit-function-declaration] 261 | (pte_marker_get(entry) & PTE_MARKER_UFFD_WP); | ^~~~~~~~~~~~~~ include/linux/userfaultfd_k.h:261:38: error: 'PTE_MARKER_UFFD_WP' undeclared (first use in this function) 261 | (pte_marker_get(entry) & PTE_MARKER_UFFD_WP); | ^~~~~~~~~~~~~~~~~~ include/linux/userfaultfd_k.h:261:38: note: each undeclared identifier is reported only once for each function it appears in In file included from include/linux/mm_inline.h:10, from mm/memory.c:44: include/linux/swapops.h: At top level: include/linux/swapops.h:289:20: error: conflicting types for 'is_pte_marker_entry'; have 'bool(swp_entry_t)' {aka '_Bool(swp_entry_t)'} 289 | static inline bool is_pte_marker_entry(swp_entry_t entry) | ^~~~~~~~~~~~~~~~~~~ In file included from include/linux/mm_inline.h:9, from mm/memory.c:44: include/linux/userfaultfd_k.h:260:16: note: previous implicit declaration of 'is_pte_marker_entry' with type 'int()' 260 | return is_pte_marker_entry(entry) && | ^~~~~~~~~~~~~~~~~~~ In file included from include/linux/mm_inline.h:10, from mm/memory.c:44: include/linux/swapops.h:294:26: error: conflicting types for 'pte_marker_get'; have 'pte_marker(swp_entry_t)' {aka 'long unsigned int(swp_entry_t)'} 294 | static inline pte_marker pte_marker_get(swp_entry_t entry) | ^~~~~~~~~~~~~~ In file included from include/linux/mm_inline.h:9, from mm/memory.c:44: include/linux/userfaultfd_k.h:261:14: note: previous implicit declaration of 'pte_marker_get' with type 'int()' 261 | (pte_marker_get(entry) & PTE_MARKER_UFFD_WP); | ^~~~~~~~~~~~~~ >> mm/memory.c:1238:1: warning: no previous prototype for 'vma_needs_copy' [-Wmissing-prototypes] 1238 | vma_needs_copy(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma) | ^~~~~~~~~~~~~~ In file included from include/linux/mm_inline.h:9, from mm/memory.c:44: include/linux/userfaultfd_k.h: In function 'pte_marker_entry_uffd_wp': include/linux/userfaultfd_k.h:262:1: error: control reaches end of non-void function [-Werror=return-type] 262 | } | ^ cc1: some warnings being treated as errors vim +/vma_needs_copy +1238 mm/memory.c 1231 1232 /* 1233 * Return true if the vma needs to copy the pgtable during this fork(). Return 1234 * false when we can speed up fork() by allowing lazy page faults later until 1235 * when the child accesses the memory range. 1236 */ 1237 bool > 1238 vma_needs_copy(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma) 1239 { 1240 /* 1241 * Always copy pgtables when dst_vma has uffd-wp enabled even if it's 1242 * file-backed (e.g. shmem). Because when uffd-wp is enabled, pgtable 1243 * contains uffd-wp protection information, that's something we can't 1244 * retrieve from page cache, and skip copying will lose those info. 1245 */ 1246 if (userfaultfd_wp(dst_vma)) 1247 return true; 1248 1249 if (src_vma->vm_flags & (VM_HUGETLB | VM_PFNMAP | VM_MIXEDMAP)) 1250 return true; 1251 1252 if (src_vma->anon_vma) 1253 return true; 1254 1255 /* 1256 * Don't copy ptes where a page fault will fill them correctly. Fork 1257 * becomes much lighter when there are big shared or private readonly 1258 * mappings. The tradeoff is that copy_page_range is more efficient 1259 * than faulting. 1260 */ 1261 return false; 1262 } 1263 -- 0-DAY CI Kernel Test Service https://01.org/lkp