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 989D0C433F5 for ; Wed, 6 Apr 2022 06:20:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A9F46B0073; Wed, 6 Apr 2022 02:18:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85A6B6B0074; Wed, 6 Apr 2022 02:18:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F9DF6B0075; Wed, 6 Apr 2022 02:18:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 60A1B6B0073 for ; Wed, 6 Apr 2022 02:18:08 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1031A183D2A33 for ; Wed, 6 Apr 2022 06:17:58 +0000 (UTC) X-FDA: 79325448636.21.329ED3B Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf08.hostedemail.com (Postfix) with ESMTP id A4C4716001E for ; Wed, 6 Apr 2022 06:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649225876; x=1680761876; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Naa24ktxw2UZOhiet3D4DF5IbUq9hEaWxUtScFptzPY=; b=CYqpq80FUzEP/NfGHhBfl4yCHmp4dT4aF8g80M8074d0ieLbtPLjBkPL 4RHjtU3llkOyj5wy7zcqipdzv3GYSmIgVtXue4dSQJdZ3NRa490qLpWt6 gCZQ6Mzg03O7gVbaEY+eIcyT1lbUkPMFjaGqy2wCvYKIEohxz2dsf0jip 44ljYxoSI1fYlyFX2Na7y+RQc7NPHRr0ci0NSDfju4ROD7X0txs1pJO8k 2+vi6hBAnqXTT67sgarAkk7uJgcvjJo2TTSdvw97oVsrt1ObZGYyDZSsU ZR5GTavE4OzsMHv9RMA+bJ6zBfXzuD68zkEGFE4pCnIGasnejb5Y72rp1 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10308"; a="285927470" X-IronPort-AV: E=Sophos;i="5.90,239,1643702400"; d="scan'208";a="285927470" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2022 23:17:55 -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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A4C4716001E X-Stat-Signature: jmtc1t49zuuoejxx7mhzs4pb5fjo8dcx Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=CYqpq80F; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf08.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=lkp@intel.com X-Rspam-User: X-HE-Tag: 1649225876-456126 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: 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