Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp230738lqe; Wed, 27 Mar 2024 04:19:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYJGxHL6qO8onPxuO4R3BXrX8iJK3hC4S9KJktTvYkQdgoxsgA9iXM949909xaGnPbVmTclZUkCLJRHGByh2LIjsST8YjUcoRZqQI9dQ== X-Google-Smtp-Source: AGHT+IHhXGaINrPmze83McXlInOaDRR31mx62Ir6wI7EwdCcgZUwsJgl/+RA/1D0cXCMuRkCXloU X-Received: by 2002:a17:902:ce83:b0:1dd:874a:c528 with SMTP id f3-20020a170902ce8300b001dd874ac528mr4070449plg.51.1711538389487; Wed, 27 Mar 2024 04:19:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711538389; cv=pass; d=google.com; s=arc-20160816; b=G95OHC5+SJtJnTuUlaaQTiPzi5Y/VDhIY7m9VVPM90g5WZzRE4TvU+ACFKY1JD1olJ wHtEqIqXKtDjCjiVJZ1z/CBfYDIfGZF27F9OHYfR9y1npi2jimjHoX1ur2u0e3sCCwbL QyW43ajJPuGYUawJEvKtQDMUHL9Tx1gHCZ4eNw3JjFqvEb9pWBtCVOZ9bEGZHKVK39kM XFr0MMrIL/vBLEtPVHXqr6naYdhx5X8pJimQDffifd3PwI7IKFua2RGfDHhk9M8NBVp4 LyYENMIea34Jni0LMD56dCHEOOEJGr9VLLbUEjd9/YqCxA3D2kLsIsVQXlUWPAaFKq6a ccfA== 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:dkim-signature:date; bh=cKnCgqbX8j13jMe515y66dUGUM6g8Vc57B9DGG+HNfI=; fh=Gt2oFKqafsgk9s68eqARTS7dWUp3JKX3bbzshpMzrNE=; b=Jg7uyKeMztv1gSEasnuZUx73bsjSQL4SxV2Qi76ShX77hyjqI/In2MvRqoxYG+uQGP 7aYakFZ9PpCYCzfxMXcw7dbArCLAK0ZrfNriOKgTOfFZiv19dx/dL1yBoYSoWT8e7/O/ GWc0LgfLR9cGhl/LfL1uMd8cFMZZPgPLMg1tG4ZL91EzZqQRorX08KoymVQZHwUr2SYg gp5gibQPSh9gMhVIbLTFQsWY5V0fZBbyjmO/sz0hXDO0e9D+E5v5v/THjI3iPBRiF0Dj ICM7r2cAJCAOmEWWEaBqmmS6LCu8W9xOeBI7fF+nUKF6Ev1WaStUSEzBFSMCJrxa8dlh A0Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=viAFksyY; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-120728-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ma13-20020a170903094d00b001e0c567bb5dsi5472410plb.425.2024.03.27.04.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 04:19:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120728-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=viAFksyY; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-120728-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id ABB3C298704 for ; Wed, 27 Mar 2024 11:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32AAE5466A; Wed, 27 Mar 2024 11:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="viAFksyY" Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 E98D347F54 for ; Wed, 27 Mar 2024 11:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711537629; cv=none; b=Ugc4BTxoWgD8KCU3XPk6Y+J16F9DAvrXGkEwCj8O7AQUP44prb6tmHizB0FB8H/IPFAo12h8zJAfS3LOXaiAHSW3F47iWU6zlzkoaypB6fJyKdZGWPSnZeB1GeEu7qF2MTLSOzVj16Wni/qMzQZlUNdVch7JZ0ypc4cKDKfHOXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711537629; c=relaxed/simple; bh=UpPwTlFeVuNhQ7A/I73hK8ipP0pDGaOECXwitkiWUE8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m8Wa6ZWcWordELSs1VWeiKqT79OC8feZXckhRIvrTjVI9Axhx1s6FmK9HZ6QK3EaY3C8DFIV2oYTMe6oGU+4RAbcKEo/5AS3lMGc0d5wJkKoUZM3a5lVs7s6pzBQWRnuNRRazwNxmQUiv+A9/ywguCkOzj5MAYI4+TIBRKQlKn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=viAFksyY; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Wed, 27 Mar 2024 20:06:53 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1711537622; 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: in-reply-to:in-reply-to:references:references; bh=cKnCgqbX8j13jMe515y66dUGUM6g8Vc57B9DGG+HNfI=; b=viAFksyY9On9ofPHgViltOSBswQioaTNLmrWYJrqfM75aywR6UkLJ839DIpYh0tFHIBvpk Gnuf4AbWRR3Pr9sDXfNeLledawBlJSB2hFUQnkNcQES8SD2t5hiwumUzqCfKhnkhKilHSw 16JuYF+j0qP2ZGL977LcqsSpmaXr/Ow= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Itaru Kitayama To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , David Hildenbrand , Donald Dutile , Eric Chanudet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/3] Speed up boot with faster linear map creation Message-ID: References: <20240326101448.3453626-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: <20240326101448.3453626-1-ryan.roberts@arm.com> X-Migadu-Flow: FLOW_OUT On Tue, Mar 26, 2024 at 10:14:45AM +0000, 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 a large portion of the > time it takes to create the linear map is issuing TLBIs. This series reworks the > kernel pgtable generation code to significantly reduce the number of TLBIs. 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-rc1): > > | Apple M2 VM | Ampere Altra| Ampere Altra| Ampere Altra > | VM, 16G | VM, 64G | VM, 256G | Metal, 512G > ---------------|-------------|-------------|-------------|------------- > | ms (%) | ms (%) | ms (%) | ms (%) > ---------------|-------------|-------------|-------------|------------- > base | 151 (0%) | 2191 (0%) | 8990 (0%) | 17443 (0%) > no-cont-remap | 77 (-49%) | 429 (-80%) | 1753 (-80%) | 3796 (-78%) > no-alloc-remap | 77 (-49%) | 375 (-83%) | 1532 (-83%) | 3366 (-81%) > lazy-unmap | 63 (-58%) | 330 (-85%) | 1312 (-85%) | 2929 (-83%) > > This series applies on top of v6.9-rc1. All mm selftests pass. I haven't yet > tested all VA size configs (although I don't anticipate any issues); I'll do > this as part of followup. The series was applied cleanly on top of v6.9-rc1+ of Linus's master branch, and boots fine on M1 VM with 14GB of memory. Just out of curiosity, how did you measure the boot time and obtain the breakdown of the execution times of each phase? Tested-by: Itaru Kitayama Thanks, Itaru. > > Thanks, > Ryan > > > Ryan Roberts (3): > arm64: mm: Don't remap pgtables per- cont(pte|pmd) block > arm64: mm: Don't remap pgtables for allocate vs populate > arm64: mm: Lazily clear pte table mappings from fixmap > > arch/arm64/include/asm/fixmap.h | 5 +- > arch/arm64/include/asm/mmu.h | 8 + > arch/arm64/include/asm/pgtable.h | 4 - > arch/arm64/kernel/cpufeature.c | 10 +- > arch/arm64/mm/fixmap.c | 11 + > arch/arm64/mm/mmu.c | 364 +++++++++++++++++++++++-------- > include/linux/pgtable.h | 8 + > 7 files changed, 307 insertions(+), 103 deletions(-) > > -- > 2.25.1 >