Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp199787lql; Fri, 12 Apr 2024 07:56:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXak9pHPAhxL9aFuvuzyVdo00Fc3B6eX4nOWSecakVVGFslEy6KJAWVRgw9qudHSXwwVdlatZvs/dZla7A0c4tVlgaEmTCTiBBj3JzRQ== X-Google-Smtp-Source: AGHT+IEPHM0r8aGjh9Lh5kDNUMxy/RKbDyMva25gH3PPOW5rjMclzKZUh9ovs6zqMr6pvHcz4O7w X-Received: by 2002:a17:907:9443:b0:a52:3f00:616d with SMTP id dl3-20020a170907944300b00a523f00616dmr839853ejc.30.1712933802203; Fri, 12 Apr 2024 07:56:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712933802; cv=pass; d=google.com; s=arc-20160816; b=XnEy4EWTRd8gwTr0st++oZ+85Cxrum2AS5y1gvL0UmG63tzpDWHkslQ5a5zxQrg6nS PuA4P2m9ZMokeM4Ec+gg8OKxMfCX1wXmcfQR52NH6UmKrNj1zDHhRw0GQh31MLA9BU3J A3DwrHkbwBwnknrGn+be3i/lAtInl09sozmYXbpZO0FJTcIs3K4d3d3WInktlgMVAq8R /yY5A760juEWr0pwr0cB8RcVKqV5/K3mrMerB/P2dgV9needrHUhHx2F/jZvnsxj7TtP SgCC3sPKtlbte83HbJK7ej5mOfFqlFwFe4GgdDq+6KQXj5X1R5Ekp6kH9OLZQuH7cXQd rELg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=IMjU/MBXFOUAGATbyEi7qNPxrIzZH4aEqhLl/kg4IjU=; fh=W+9ls2lXxWDB5S5KnbOOX96cO9LtPtmCaEq1dAhSSQI=; b=BfWChx2lzB1nn+FFqsy8BMMm+SnMR/JZs6K17ShFvoxtpEHs1sDGiwxrCllXn0+6iu J3mrtt3S9Jr/N5bBeNckNlsnzcHT3tIHscr+tkzycjUpFQMiFsizhQeQcdmfTxlhJreI kjcBFfcaoPqV93ByDMKzyeFN/xtO1B4KIvNqBNm6oWtWompdtXg3dkIHYDg5gew00v+k Bon0WVjAKvX7w5oLGpbMAfRTcB/ObSezjs/tyiKvYdI3ErjPkw8Ev0uW/bJp3wXFFYxk /ZVkhgr7lOOwtwUrVWir2aSi0p6baDPixujLjcP43kq17aZLuIpZXjckw75RLvwiCfq0 Fj7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-142884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kw25-20020a170907771900b00a4747bdb536si1781833ejc.255.2024.04.12.07.56.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:56:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-142884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 am.mirrors.kernel.org (Postfix) with ESMTPS id CBFB41F2254F for ; Fri, 12 Apr 2024 14:56:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27AAD146A7F; Fri, 12 Apr 2024 14:56:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5477383CD8 for ; Fri, 12 Apr 2024 14:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712933779; cv=none; b=tfhC0wZxMQoqMeRBhHNjVcTuOA56i8Mntftriwuv8KW0N4acBTcX9yVZrj+rgHq5ox+mSRlTwOeAi5De0dp6cxMOMkvv1bcInwDMraQ71r7O6Ym7FX339crWWjZQQXkpQ5fBlrim6TYGkfF1GGxfl1NUJ+21CwQwGy/r0B2Gsdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712933779; c=relaxed/simple; bh=Hy6hh7uApPUxf7/MqJfKIj9pzl3U6tocuYJF5Ds3Qac=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=les3J3ThJ1SKhy8/t7whM3QUMul+7F5CXlf4BWp6SuQRLraSMazlz5uTU4hK3aFk1DI9A1EQ6rYwm0AGuk3SMnEOeG2SXmCR6imRBQvpuXUGLO1Ytb316FOpMicQZVd9RL5JRtN4X210htWXeGPJdXkoiIVMk6afpLJJr2GeCgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8ECDA339; Fri, 12 Apr 2024 07:56:46 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.37.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C7963F64C; Fri, 12 Apr 2024 07:56:16 -0700 (PDT) Date: Fri, 12 Apr 2024 15:56:08 +0100 From: Mark Rutland To: Ryan Roberts , Catalin Marinas , Will Deacon Cc: Ard Biesheuvel , David Hildenbrand , Donald Dutile , Eric Chanudet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/3] Speed up boot with faster linear map creation Message-ID: References: <20240412131908.433043-1-ryan.roberts@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412131908.433043-1-ryan.roberts@arm.com> On Fri, Apr 12, 2024 at 02:19:05PM +0100, Ryan Roberts wrote: > Hi All, > > It turns out that creating the linear map can take a significant proportion of > the total boot time, especially when rodata=full. And most of the time is spent > waiting on superfluous tlb invalidation and memory barriers. This series reworks > the kernel pgtable generation code to significantly reduce the number of those > TLBIs, ISBs and DSBs. See each patch for details. > > The below shows the execution time of map_mem() across a couple of different > systems with different RAM configurations. We measure after applying each patch > and show the improvement relative to base (v6.9-rc2): > > | Apple M2 VM | Ampere Altra| Ampere Altra| Ampere Altra > | VM, 16G | VM, 64G | VM, 256G | Metal, 512G > ---------------|-------------|-------------|-------------|------------- > | ms (%) | ms (%) | ms (%) | ms (%) > ---------------|-------------|-------------|-------------|------------- > base | 168 (0%) | 2198 (0%) | 8644 (0%) | 17447 (0%) > no-cont-remap | 78 (-53%) | 435 (-80%) | 1723 (-80%) | 3779 (-78%) > batch-barriers | 11 (-93%) | 161 (-93%) | 656 (-92%) | 1654 (-91%) > no-alloc-remap | 10 (-94%) | 104 (-95%) | 438 (-95%) | 1223 (-93%) > > This series applies on top of v6.9-rc2. All mm selftests pass. I've compile and > boot tested various PAGE_SIZE and VA size configs. Nice! > Ryan Roberts (3): > arm64: mm: Don't remap pgtables per-cont(pte|pmd) block > arm64: mm: Batch dsb and isb when populating pgtables > arm64: mm: Don't remap pgtables for allocate vs populate For the series: Reviewed-by: Mark Rutland Catalin, Will, are you happy to pick this up? Mark.