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 C286FEB64DC for ; Mon, 3 Jul 2023 15:52:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1033F280016; Mon, 3 Jul 2023 11:52:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B352280001; Mon, 3 Jul 2023 11:52:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBD63280016; Mon, 3 Jul 2023 11:52:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DCC38280001 for ; Mon, 3 Jul 2023 11:52:24 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A0038C091B for ; Mon, 3 Jul 2023 15:52:24 +0000 (UTC) X-FDA: 80970742608.04.F74FF17 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf08.hostedemail.com (Postfix) with ESMTP id 37174160015 for ; Mon, 3 Jul 2023 15:52:20 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ByllUyPQ; spf=pass (imf08.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688399542; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=trc9MfgfLjnlJ1IYNrI+XXfg47LdCpI3kUCCSQp1krw=; b=nwVcQPxInOEWcHdTK8YORAq5M68B85f6czwyOiDUsFbgA8rXDvEOEZ7s+ySFzjKTq1V0sA T8GTEkjbDZu9AtprjJYZYnEuchOkT73fqU4ACBPUkJWFTRGDljn7mLLXF9K/ptzBVoZ6Oo JeclSBO28rGvZrO74RaznvwBNMP80MU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ByllUyPQ; spf=pass (imf08.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688399542; a=rsa-sha256; cv=none; b=IJjTouz8ZyV9cC6fxdLcoac0gCSNvRmd2ZpBwRcpiat8ycgdwl0+0yKanKCCO2Jn7LQQzV U8cQ+B5fkgvzX6ZCpOvYUhjrWoxLwZeoWg5s2A0DZegYntSQ6uhgNz/760GgDtSFfUnSng bD0dkRCsQD9ENNkMNalkkQ6IeHSeOdM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688399541; x=1719935541; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kg4H8EJxzT+JmzsPx5yMUTbVFym+TvfIau+EfU0TlSE=; b=ByllUyPQNApvw22DjBWltHnx22/DUNMpfhfYi62/VuIA0UQUXjFgy134 nUU/bpyHFF16hk9AaYDPYtz1cf0A3sD/BMEXILUE9TcAu/lV/PJbrETEG ys3pHRMsnJZ96rmJExxYte6O/U6ijxTMkcpGOFJnTEUEqOgoGytxHe0o6 qRJg09evjup2lceCF8+uuDmo5hTGcpWtz19MDh7NiWPEe7Z1Nh6pb7vt6 vMDmO/JYfxwL4LE5+B5z2IlB00kJcRM/JGDcE5V9XYVgon6Gv7WtQFQFN QkuWazGFsIfwFJpw2591f0XMcq4kMyJRoSTjYTCvuUXd1eH36yo+Cjiul w==; X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="365488052" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="365488052" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 08:52:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="965225256" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="965225256" Received: from lkp-server01.sh.intel.com (HELO 783282924a45) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 03 Jul 2023 08:52:14 -0700 Received: from kbuild by 783282924a45 with local (Exim 4.96) (envelope-from ) id 1qGLqX-000HSJ-0u; Mon, 03 Jul 2023 15:52:13 +0000 Date: Mon, 3 Jul 2023 23:51:46 +0800 From: kernel test robot To: Ryan Roberts , Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/5] mm: FLEXIBLE_THP for improved performance Message-ID: <202307032325.u93xmWbG-lkp@intel.com> References: <20230703135330.1865927-5-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703135330.1865927-5-ryan.roberts@arm.com> X-Rspamd-Queue-Id: 37174160015 X-Rspam-User: X-Stat-Signature: 6qccfi5c8pqyb16yuw7ko1dn3ghjqrkd X-Rspamd-Server: rspam01 X-HE-Tag: 1688399540-95147 X-HE-Meta: U2FsdGVkX19jf15JmlTkNg9BnZkNbSeeoaXKOOj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htarVUXn5HYAvh1Vp/ztCrKXyHCxoGjbK5ax9GMEMHqrBD1zHxy37GRtPD5KGoYQPOG8FRgf6PqHS+54uaOj/uXslUo5GcmSRzaYAI7RMcHaDnOPv6Enr+BDFuOFPHe70kFiCbB3iikBg0Oaod5N8UzqYUqJi+LKwiMBnYXSPOap9e81EgJEeXarPcEtxbks6sauYQWdmNZp0SNNjWkdp7O15PzMJEEKOF5nEOHPG8asdnhsnFIeljkuSuwwNNkBF3HdgQEUB6SM10OFfVyY1U8qOQofyTiPDx7lnCJyKIFWpyLthKoQaBdK66XGJr/Ij4Crle6hL+mZVmrFFTkU+F7yHEtq4/7YO4D8uWj5a 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 Ryan, kernel test robot noticed the following build errors: [auto build test ERROR on arm64/for-next/core] [also build test ERROR on v6.4] [cannot apply to akpm-mm/mm-everything linus/master next-20230703] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Ryan-Roberts/mm-Non-pmd-mappable-large-folios-for-folio_add_new_anon_rmap/20230703-215627 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core patch link: https://lore.kernel.org/r/20230703135330.1865927-5-ryan.roberts%40arm.com patch subject: [PATCH v2 4/5] mm: FLEXIBLE_THP for improved performance config: um-allyesconfig (https://download.01.org/0day-ci/archive/20230703/202307032325.u93xmWbG-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce: (https://download.01.org/0day-ci/archive/20230703/202307032325.u93xmWbG-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202307032325.u93xmWbG-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from mm/memory.c:42: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from mm/memory.c:42: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from mm/memory.c:42: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ >> mm/memory.c:4271:2: error: implicit declaration of function 'set_ptes' is invalid in C99 [-Werror,-Wimplicit-function-declaration] set_ptes(vma->vm_mm, addr, vmf->pte, entry, pgcount); ^ mm/memory.c:4271:2: note: did you mean 'set_pte'? arch/um/include/asm/pgtable.h:232:20: note: 'set_pte' declared here static inline void set_pte(pte_t *pteptr, pte_t pteval) ^ >> mm/memory.c:4274:2: error: implicit declaration of function 'update_mmu_cache_range' is invalid in C99 [-Werror,-Wimplicit-function-declaration] update_mmu_cache_range(vma, addr, vmf->pte, pgcount); ^ 12 warnings and 2 errors generated. vim +/set_ptes +4271 mm/memory.c 4135 4136 /* 4137 * We enter with non-exclusive mmap_lock (to exclude vma changes, 4138 * but allow concurrent faults), and pte mapped but not yet locked. 4139 * We return with mmap_lock still held, but pte unmapped and unlocked. 4140 */ 4141 static vm_fault_t do_anonymous_page(struct vm_fault *vmf) 4142 { 4143 bool uffd_wp = vmf_orig_pte_uffd_wp(vmf); 4144 struct vm_area_struct *vma = vmf->vma; 4145 struct folio *folio; 4146 vm_fault_t ret = 0; 4147 pte_t entry; 4148 int order; 4149 int pgcount; 4150 unsigned long addr; 4151 4152 /* File mapping without ->vm_ops ? */ 4153 if (vma->vm_flags & VM_SHARED) 4154 return VM_FAULT_SIGBUS; 4155 4156 /* 4157 * Use pte_alloc() instead of pte_alloc_map(). We can't run 4158 * pte_offset_map() on pmds where a huge pmd might be created 4159 * from a different thread. 4160 * 4161 * pte_alloc_map() is safe to use under mmap_write_lock(mm) or when 4162 * parallel threads are excluded by other means. 4163 * 4164 * Here we only have mmap_read_lock(mm). 4165 */ 4166 if (pte_alloc(vma->vm_mm, vmf->pmd)) 4167 return VM_FAULT_OOM; 4168 4169 /* See comment in handle_pte_fault() */ 4170 if (unlikely(pmd_trans_unstable(vmf->pmd))) 4171 return 0; 4172 4173 /* Use the zero-page for reads */ 4174 if (!(vmf->flags & FAULT_FLAG_WRITE) && 4175 !mm_forbids_zeropage(vma->vm_mm)) { 4176 entry = pte_mkspecial(pfn_pte(my_zero_pfn(vmf->address), 4177 vma->vm_page_prot)); 4178 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, 4179 vmf->address, &vmf->ptl); 4180 if (vmf_pte_changed(vmf)) { 4181 update_mmu_tlb(vma, vmf->address, vmf->pte); 4182 goto unlock; 4183 } 4184 ret = check_stable_address_space(vma->vm_mm); 4185 if (ret) 4186 goto unlock; 4187 /* Deliver the page fault to userland, check inside PT lock */ 4188 if (userfaultfd_missing(vma)) { 4189 pte_unmap_unlock(vmf->pte, vmf->ptl); 4190 return handle_userfault(vmf, VM_UFFD_MISSING); 4191 } 4192 if (uffd_wp) 4193 entry = pte_mkuffd_wp(entry); 4194 set_pte_at(vma->vm_mm, vmf->address, vmf->pte, entry); 4195 4196 /* No need to invalidate - it was non-present before */ 4197 update_mmu_cache(vma, vmf->address, vmf->pte); 4198 goto unlock; 4199 } 4200 4201 /* 4202 * If allocating a large folio, determine the biggest suitable order for 4203 * the VMA (e.g. it must not exceed the VMA's bounds, it must not 4204 * overlap with any populated PTEs, etc). We are not under the ptl here 4205 * so we will need to re-check that we are not overlapping any populated 4206 * PTEs once we have the lock. 4207 */ 4208 order = uffd_wp ? 0 : max_anon_folio_order(vma); 4209 if (order > 0) { 4210 vmf->pte = pte_offset_map(vmf->pmd, vmf->address); 4211 order = calc_anon_folio_order_alloc(vmf, order); 4212 pte_unmap(vmf->pte); 4213 } 4214 4215 /* Allocate our own private folio. */ 4216 if (unlikely(anon_vma_prepare(vma))) 4217 goto oom; 4218 folio = alloc_anon_folio(vma, vmf->address, order); 4219 if (!folio && order > 0) { 4220 order = 0; 4221 folio = alloc_anon_folio(vma, vmf->address, order); 4222 } 4223 if (!folio) 4224 goto oom; 4225 4226 pgcount = 1 << order; 4227 addr = ALIGN_DOWN(vmf->address, pgcount << PAGE_SHIFT); 4228 4229 if (mem_cgroup_charge(folio, vma->vm_mm, GFP_KERNEL)) 4230 goto oom_free_page; 4231 folio_throttle_swaprate(folio, GFP_KERNEL); 4232 4233 /* 4234 * The memory barrier inside __folio_mark_uptodate makes sure that 4235 * preceding stores to the folio contents become visible before 4236 * the set_ptes() write. 4237 */ 4238 __folio_mark_uptodate(folio); 4239 4240 entry = mk_pte(&folio->page, vma->vm_page_prot); 4241 entry = pte_sw_mkyoung(entry); 4242 if (vma->vm_flags & VM_WRITE) 4243 entry = pte_mkwrite(pte_mkdirty(entry)); 4244 4245 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, addr, &vmf->ptl); 4246 if (vmf_pte_changed(vmf)) { 4247 update_mmu_tlb(vma, vmf->address, vmf->pte); 4248 goto release; 4249 } else if (order > 0 && check_ptes_none(vmf->pte, pgcount) != pgcount) { 4250 goto release; 4251 } 4252 4253 ret = check_stable_address_space(vma->vm_mm); 4254 if (ret) 4255 goto release; 4256 4257 /* Deliver the page fault to userland, check inside PT lock */ 4258 if (userfaultfd_missing(vma)) { 4259 pte_unmap_unlock(vmf->pte, vmf->ptl); 4260 folio_put(folio); 4261 return handle_userfault(vmf, VM_UFFD_MISSING); 4262 } 4263 4264 folio_ref_add(folio, pgcount - 1); 4265 add_mm_counter(vma->vm_mm, MM_ANONPAGES, pgcount); 4266 folio_add_new_anon_rmap(folio, vma, addr); 4267 folio_add_lru_vma(folio, vma); 4268 4269 if (uffd_wp) 4270 entry = pte_mkuffd_wp(entry); > 4271 set_ptes(vma->vm_mm, addr, vmf->pte, entry, pgcount); 4272 4273 /* No need to invalidate - it was non-present before */ > 4274 update_mmu_cache_range(vma, addr, vmf->pte, pgcount); 4275 unlock: 4276 pte_unmap_unlock(vmf->pte, vmf->ptl); 4277 return ret; 4278 release: 4279 folio_put(folio); 4280 goto unlock; 4281 oom_free_page: 4282 folio_put(folio); 4283 oom: 4284 return VM_FAULT_OOM; 4285 } 4286 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki