Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2481232rdb; Mon, 12 Feb 2024 06:24:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkkzySmliO5DWLbRHOxHZLtYjTj6H36pxfFE4Ru5ZpwAHtzLB4qaoqIIOFGCaOcsoNqNhT X-Received: by 2002:a05:6a00:26c9:b0:6e0:f287:d744 with SMTP id p9-20020a056a0026c900b006e0f287d744mr290406pfw.19.1707747870821; Mon, 12 Feb 2024 06:24:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707747870; cv=pass; d=google.com; s=arc-20160816; b=UZ5hcuxAXbUHjVZPRvdqzNZ4exQOvV3lZd39v3VUY2N11eMsQQq/5BM14SOVJ7+XtQ pTDJ2vs93l4Fw59BeyidZA61JR0yWRvjw6fXMUj9tcWXS3t4ucXlfEKEMiWDTQysSs34 uA4doyeh+n5zQi5Wgp464ZCKHzdPYPAtPOTY1bpNjG5bcVTNRT2J7PntCvhKObN4QEoK c+0fD22ISUcwRwP1Nhic39c6OqMPuTqSPXUOA8gAizPeo2c9DskJDHn26FL3yIn/yPqb UoXwMaBGifVhlooPWDU1vc6eFu+CnAJLJjfzArBIJ0NjBV4FrUkvd4sED6+jhSDrxPnX 5wcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=zKmWeo9+M/EVmSRX3wQ2UDRqy7D6ms4Kk2jOrOYSGJE=; fh=EQSS9Gjsqmwj+M4fgpQ4HUGi+svtGDu5o7H1oyv4XcU=; b=esicgIMaftQkF3RkK9I/xiSbIYC1LM/sd7zzK4lnfrfrThpnHBBU9bOsiRQqyq1nW0 8wF5eqdTpms+D7WGwJftECiH4FDaSypoVdnJLwHCvruFWyP/LndG5fAVvUT5OG4nv8pE jvEq8j+I5iU2YBsNOj2J2ndvHcfzR8CCLoHyeOeDhZbPGqkgffG2FK+rxuuXZ9crtTqL ytV6QxUY8UUlKcWv+FZ2moRiwghcLPiDFLQSYh6ZMSMUDWCRL8Kzh5VYFwnmq5zfN+OW PDAsjJqH3sDWuasI51jCBtsBoPdCY0wRECXtA+xO0mRV/cnnWfIkTR7ZH7tbPRRwqZff 8QoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Vtjq4HhY; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXCYOPTaNbi44jgZUE3iJl6H80wVawuDFZygQq4Y9n7QCKprGj9Q/Y/oiiFcS5rfLguu22xTqpmT5JWWFuZ+2Y1AaYRu+jZFYemAG8e9Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s26-20020a63925a000000b005dc1c316cf5si305926pgn.357.2024.02.12.06.24.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:24:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Vtjq4HhY; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0A03BB2632E for ; Mon, 12 Feb 2024 13:56:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CD3E41A85; Mon, 12 Feb 2024 13:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Vtjq4HhY" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CB2041760 for ; Mon, 12 Feb 2024 13:46:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707745598; cv=none; b=dxTJLEeMbKU0Mi5RQAoclXSGL3Pdr2d4KlYSW8Q1TVQ8uaYXHdUDNxlrCpcmRELsY/f3wXQ9nwttxBQ3Bql2Z1GpTSo95xhF1u/nNT+6T/Zc7Q/z01hZsvrjARVr0hHdYe3lRWuWI75tYiwTKBxXS5PXksh0odg7d5vcLmcqc6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707745598; c=relaxed/simple; bh=xikkpXmyFAcuUoOrG6d/5jzB1Pf8+Rswqj6mZIPkvUM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ct4T++GKzXzCWEwuS7E0iSuctLt87dNx3yMVFhapL/2hVA7fVPznzsjuRjijvrAdtkNWBkQRrj9+3cl923rEaCodQJVIz/7lCh/yJJWXB3hNBNI3uR2hnLlwkd3z39/N8y4vS3k2oGCYfkH5Ne3sVkzIZ5+W130l8wBL4CGEWo8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Vtjq4HhY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707745595; 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=zKmWeo9+M/EVmSRX3wQ2UDRqy7D6ms4Kk2jOrOYSGJE=; b=Vtjq4HhYvrMeGxXFTvz9XmezIw2g/V4L+mSfys8ZVoHO7RP5VepZkOZZILMf+fb5/NvNZ+ RAjbjsyPI7GzXJhbPbgYhAh38SgywVgkNr7/1QFGVrEIqH4EBV21zu92kH1GDMQ8nXzlhG w9I6Mh34qJPhovKUEGuHvL1f3rVB3K8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-8YY19zYLOLOQ1aXs_209vg-1; Mon, 12 Feb 2024 08:46:33 -0500 X-MC-Unique: 8YY19zYLOLOQ1aXs_209vg-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-411a8c8d9b2so259495e9.0 for ; Mon, 12 Feb 2024 05:46:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707745592; x=1708350392; 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=zKmWeo9+M/EVmSRX3wQ2UDRqy7D6ms4Kk2jOrOYSGJE=; b=F98rz292j959HEEDP62kh0i9X1VhohErxezEJvyGlUulZbTriVxVs6wtjuWKeic7XE rXkLeCKkvGyiSe21lUyrUcwYzbYVZAm6uBraWTCkr92U6s8Klc/6rFWTDpphIKb1PWWH StG8DDk5F+OX0PLp3az1tinASUIw6SWtq49ribvqoZGkxFO9I2Rg1FqW16AcG17iGfhn qhuSNFeJqur/SMemfY7WVAeqSqekgfa+MA44eIqnbEaHPfDV8X7STMgtUblCG3rjrMr8 44O4HDjV63ePeILyGdVAvzD+zFBGnD/eyGp3WjguDQNwUFGdpxTpf935Lkjv1TbKi0z0 y6HQ== X-Gm-Message-State: AOJu0YygV5FRGZ6TsIUciwzS0/bRPT9ioRDV/i21oLXSsCAdAWIKcpsi KK+MX8iM+xCQHq5AK9nNBUnTeRq2Vct9ZXYHP+60iomV5WShEB729ATCM3hHAh6Ss+pet6Q2kaT 81795qHhpgFAWpdb6v8UDnTt31gQoQoSD5qod8AHjc26sjV7hCCrhdA4Pdxhucg== X-Received: by 2002:a05:600c:600c:b0:40f:dd3f:ba10 with SMTP id az12-20020a05600c600c00b0040fdd3fba10mr5191822wmb.33.1707745592208; Mon, 12 Feb 2024 05:46:32 -0800 (PST) X-Received: by 2002:a05:600c:600c:b0:40f:dd3f:ba10 with SMTP id az12-20020a05600c600c00b0040fdd3fba10mr5191806wmb.33.1707745591828; Mon, 12 Feb 2024 05:46:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWCSlxX41BvMfnIBhcdGMZl2lpBgDcDwOePABXkky0P/nzfUyDQBurJsAC3Rn3aYzEm/pJ2z2nKq3q9uku6xtqumdrSJjwcg9jmi9ZtIr0RKMGHnotL+yzYf9S4zwcj9Mwke+TnVtm953ifsd+mAUtGezxZpC8ZYxvBTfaRGnHiBRWA4rwgWRpVHGR6V88CfmKY2N3ho7Pf/7Hc+u2GBeR6q4rfUR+0kqgHgK2csKAaYfcwPLubnPICkGsiadrWMCYxoBq59OJpCKV8HPB3DK0Jd9YBI4qRgSkEVh0MGH7LLuSPzmcxBpGXCOQVjwE7giZT/VGSTggJV8NyHJU5fzuxCjD/XoK51wGF0xMNhBsnY9wonx3Bh71NABVFQylEiw3Ozwj4SsPh+9TewX1N0HvdydqsM1pWlrREKRdCWA+ZINOAFdafvKhpvTa4Dv8uPGJNys0K5oF1AdGel45TsEJGqWY1OPxASaQSXnsJHN31/0lqrHibmRZrAykgO8LtpqC+5ka75mhYkB8Vfgz0um22P1zoO2RnXZDA2vvqoucMqgq333sh6PvCYS6qubIgTk0e4+cjAQhcmy8goEm+4p3N5bowH49+Dl3k19fjuKTCZ3VS3z+xO9xx+AHRB3Hp0x0S/NsnvXrjEfiUvh9jmFcFdJcjCRVXM3OI5aXwLgkidGx1dfhPY/XmCneBxMIzEMhgr4TT7AgXQ9K1wKBM8RUCKhX/1Q9LsYRwmFTapKgO+sW8wZcgCLnH/RoOgsXPiSG13jhj/0qpEwAdyELrgclPl//O1YHwJ41ZoDegk3J4Ey7oJpDDvUQ9GWn6IG3bFrPBcihymlcw8yRF5mdIDs7dlGNU8GwwJqloiwJDZgSJ Received: from ?IPV6:2003:cb:c730:2200:7229:83b1:524e:283a? (p200300cbc7302200722983b1524e283a.dip0.t-ipconnect.de. [2003:cb:c730:2200:7229:83b1:524e:283a]) by smtp.gmail.com with ESMTPSA id cl7-20020a5d5f07000000b0033b8881f31dsm762856wrb.68.2024.02.12.05.46.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 05:46:31 -0800 (PST) Message-ID: <40889617-0820-473e-86ed-04eca6489169@redhat.com> Date: Mon, 12 Feb 2024 14:46:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 23/25] arm64/mm: Implement pte_batch_hint() Content-Language: en-US To: Ryan Roberts , Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , James Morse , Andrey Ryabinin , Andrew Morton , Matthew Wilcox , Mark Rutland , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240202080756.1453939-1-ryan.roberts@arm.com> <20240202080756.1453939-24-ryan.roberts@arm.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//bLwzj9IVs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Z2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20240202080756.1453939-24-ryan.roberts@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02.02.24 09:07, Ryan Roberts wrote: > When core code iterates over a range of ptes and calls ptep_get() for > each of them, if the range happens to cover contpte mappings, the number > of pte reads becomes amplified by a factor of the number of PTEs in a > contpte block. This is because for each call to ptep_get(), the > implementation must read all of the ptes in the contpte block to which > it belongs to gather the access and dirty bits. > > This causes a hotspot for fork(), as well as operations that unmap > memory such as munmap(), exit and madvise(MADV_DONTNEED). Fortunately we > can fix this by implementing pte_batch_hint() which allows their > iterators to skip getting the contpte tail ptes when gathering the batch > of ptes to operate on. This results in the number of PTE reads returning > to 1 per pte. > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts > --- > arch/arm64/include/asm/pgtable.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h > index ad04adb7b87f..353ea67b5d75 100644 > --- a/arch/arm64/include/asm/pgtable.h > +++ b/arch/arm64/include/asm/pgtable.h > @@ -1220,6 +1220,15 @@ static inline void contpte_try_unfold(struct mm_struct *mm, unsigned long addr, > __contpte_try_unfold(mm, addr, ptep, pte); > } > > +#define pte_batch_hint pte_batch_hint > +static inline unsigned int pte_batch_hint(pte_t *ptep, pte_t pte) > +{ > + if (!pte_valid_cont(pte)) > + return 1; > + > + return CONT_PTES - (((unsigned long)ptep >> 3) & (CONT_PTES - 1)); > +} > + > /* > * The below functions constitute the public API that arm64 presents to the > * core-mm to manipulate PTE entries within their page tables (or at least this Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb