Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3174364rdb; Thu, 16 Nov 2023 02:13:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmdUySisNqStpfdHFoenS53y9scRADZ9t/wCSiNyHCMqSpa6qdDeddVTm5iDaHkt7KOFJY X-Received: by 2002:a62:fb0e:0:b0:68b:bf33:2957 with SMTP id x14-20020a62fb0e000000b0068bbf332957mr11470857pfm.22.1700129586225; Thu, 16 Nov 2023 02:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700129586; cv=none; d=google.com; s=arc-20160816; b=xPRcUGy8wl6LDrqmISfU5BkHWxc/79dXoLi0M95lI5Ht7+Moht0Ky551qHOFKX1483 +z8Bir9mJUcXc9DBcKFQt/30HLTyHIiEmEC8jgcWKSrnEjJAIx87OAOiY+gtYwOJjNcK a713mNhSXThgMDVGC9CcqJwdAgpm9ElwOeigoyUODDX/1UctXPRvEwFRduoXEClW4dMz DqMmac+fOdibTqg+Bb0d/EF1tcQzKXLrQLh/dPexyVOVFg2DTvD+8oJBdtdOGUxDGMEz DMYldCI9fvPnXsmL4Ecw/RrezqvptsSK11hEl/iv8AL5iX70R69fzASBFJCGyqglhQx5 wqxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:autocrypt:from:references:cc:to:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=5ZBbfhLMJV0XF/JRhcYrRxUZLfjN1NPiJz+tDpv7jDU=; fh=JarPnzcPZhcYNUsKtt+xMT+vuop5Ra4PqwQhPmLhlJE=; b=hEUepzPueCXEWJQkeWzKr75HAR4UQvGvOCU/iQBtO/leoddCsa+JFwXVD5rTZR0LY4 qP11kz6yPugo7LuXGfIVBY5PCAnhefsyWAYs8U86l6beUDWdxDWcRxsdAntfOlBH69Eb roDXdTGrQdeY+5fR+o2UNUr2PPrL/LBF5z5SGiwkH2Q6O/u+RdDzv/fq5WbBoEV2gocY xgTqw+O3HDv9rigXanqRqkFhjqwSJQCNU9uhkqAxjTfF/3uvqioU+ZqiDazKWpkZjmas VYIda38UmJaEHSGWoSRmHrAhewuJieWA5dbVxgEXAPOOwdsBd1N0I/OKomf/f8VBivdj WFtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aoCcYi6d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q9-20020a056a00088900b0068a54522bb0si12535730pfj.144.2023.11.16.02.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aoCcYi6d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 663FC816F043; Thu, 16 Nov 2023 02:13:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344979AbjKPKMg (ORCPT + 99 others); Thu, 16 Nov 2023 05:12:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjKPKMc (ORCPT ); Thu, 16 Nov 2023 05:12:32 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0845319F for ; Thu, 16 Nov 2023 02:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700129548; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=5ZBbfhLMJV0XF/JRhcYrRxUZLfjN1NPiJz+tDpv7jDU=; b=aoCcYi6dFKwqKrSC7cYWxkKdqp85R+NxlJa7gsIYPOXa+sVF3xhVRCWLJTIZpeXm4beA7W bK0OhS+gR3qdMiOi0UZWx6t7gyIyHNEl6rNj77WWxSV8/w6iO0h9zO+S3UJxHpFvOb0HB7 yT+NizVxaD7hDT2OI4Q/d6kNLkHcW2M= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-266-M78Q_vDvN8Sl9VM3fK_NzA-1; Thu, 16 Nov 2023 05:12:25 -0500 X-MC-Unique: M78Q_vDvN8Sl9VM3fK_NzA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-32f8c4b74f7so325349f8f.0 for ; Thu, 16 Nov 2023 02:12:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700129544; x=1700734344; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5ZBbfhLMJV0XF/JRhcYrRxUZLfjN1NPiJz+tDpv7jDU=; b=Nq0UxO5FbQUEcJna+Cc0+F+rhVVGQp0z+5CtX22rHJBVmJti7ZWSG5DTz4mDt1myy1 txMTr8nr6So5oQUT6dfRsJxO0B5RNbuXulzHBI2gfpSt+WnD/+5nkZUghpiZtVLOzG/E bFsaH1gNO8iiJ1PNdJ6RSY+wPYNqltsCm67s9DS179tiz+pIPkpaRONvk6F7Ig80NYHp kdcU4v1PQvJub6BnlKJTAdHdx36sid4/fyQoXtIsbiH6bcCKiQ5aDRDNVZMoiD0szZYS 8g1oRsitNoP+GLuOORJyLUN2Nrp044ysUwGouTb0DdA1Qbzhtrvcv/RZpcLQ/d8tP3LB YgxA== X-Gm-Message-State: AOJu0Yyjpl9r8KCjkAzJSGQWYM1QodcQD7E74vFn039h+4v8rs8IggEg qU7bQ8L/JxHpCNwvd80z2/wWKOINH4OiW3F+Ix/fn/JHrbsBTrnRZ+Ab7qpBvLRAnFNyICIkbcu Bh2h0Lun48qntlbmmBZajd6Av X-Received: by 2002:adf:b34e:0:b0:32d:ccdf:69f2 with SMTP id k14-20020adfb34e000000b0032dccdf69f2mr1167278wrd.26.1700129544295; Thu, 16 Nov 2023 02:12:24 -0800 (PST) X-Received: by 2002:adf:b34e:0:b0:32d:ccdf:69f2 with SMTP id k14-20020adfb34e000000b0032dccdf69f2mr1167254wrd.26.1700129543860; Thu, 16 Nov 2023 02:12:23 -0800 (PST) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id e14-20020adfe7ce000000b0032d2489a399sm13087757wrn.49.2023.11.16.02.12.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 02:12:23 -0800 (PST) Message-ID: <4e8d329c-eda6-4ff8-bb56-8924bb4583b2@redhat.com> Date: Thu, 16 Nov 2023 11:12:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/14] mm: Batch-copy PTE ranges during fork() Content-Language: en-US To: Ryan Roberts , kernel test robot , Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Andrew Morton , Anshuman Khandual , Matthew Wilcox , Yu Zhao , Mark Rutland , Kefeng Wang , John Hubbard , Zi Yan Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231115163018.1303287-2-ryan.roberts@arm.com> <202311160516.kHhfmjvl-lkp@intel.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ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oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 16 Nov 2023 02:13:03 -0800 (PST) On 16.11.23 11:07, Ryan Roberts wrote: > Hi All, > > Hoping for some guidance below! > > > On 15/11/2023 21:26, kernel test robot wrote: >> Hi Ryan, >> >> kernel test robot noticed the following build errors: >> >> [auto build test ERROR on akpm-mm/mm-everything] >> [also build test ERROR on linus/master v6.7-rc1 next-20231115] >> [cannot apply to arm64/for-next/core efi/next] >> [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-Batch-copy-PTE-ranges-during-fork/20231116-010123 >> base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything >> patch link: https://lore.kernel.org/r/20231115163018.1303287-2-ryan.roberts%40arm.com >> patch subject: [PATCH v2 01/14] mm: Batch-copy PTE ranges during fork() >> config: arm-randconfig-002-20231116 (https://download.01.org/0day-ci/archive/20231116/202311160516.kHhfmjvl-lkp@intel.com/config) >> compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 >> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231116/202311160516.kHhfmjvl-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/202311160516.kHhfmjvl-lkp@intel.com/ >> >> All errors (new ones prefixed by >>): >> >> mm/memory.c: In function 'folio_nr_pages_cont_mapped': >>>> mm/memory.c:969:16: error: implicit declaration of function 'pte_pgprot'; did you mean 'ptep_get'? [-Werror=implicit-function-declaration] >> 969 | prot = pte_pgprot(pte_mkold(pte_mkclean(ptent))); >> | ^~~~~~~~~~ >> | ptep_get >> cc1: some warnings being treated as errors > > It turns out that pte_pgprot() is not universal; its only implemented by > architectures that select CONFIG_HAVE_IOREMAP_PROT (currently arc, arm64, > loongarch, mips, powerpc, s390, sh, x86). > > I'm using it in core-mm to help calculate the number of "contiguously mapped" > pages within a folio (note that's not the same as arm64's notion of > contpte-mapped. I just want to know that there are N physically contiguous pages > mapped virtually contiguously with the same permissions). And I'm using > pte_pgprot() to extract the permissions for each pte to compare. It's important > that we compare the permissions because just because the pages belongs to the > same folio doesn't imply they are mapped with the same permissions; think > mprotect()ing a sub-range. > > I don't have a great idea for how to fix this - does anyone have any thoughts? KIS :) fork() operates on individual VMAs if I am not daydreaming. Just check for the obvious pte_write()/dirty/ and you'll be fine. If your code tries to optimize "between VMAs", you really shouldn't be doing that at this point. If someone did an mprotect(), there are separate VMAs, and you shouldn't be looking at the PTEs belonging to a different VMA. -- Cheers, David / dhildenb