Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2310709pxb; Wed, 9 Feb 2022 15:51:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzz3E4KYkZZq6NyXocFqzlviOWS04O8mlqbUmcogy11rJY4xVXnbLv515oEfEqHY77uvzkH X-Received: by 2002:a05:6a00:2283:: with SMTP id f3mr4835174pfe.24.1644450704025; Wed, 09 Feb 2022 15:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644450704; cv=none; d=google.com; s=arc-20160816; b=rvA3GOpkAHU+ba8GOcrhqNguOi7qgh160zmZiLt0kR4llIIsfXWxDnFRYpOveRycuA NctMrXEL1I6Af4pJozCsCSoTnviqAX1r5sjfoa+mM5B0+u0vaIVkg8zYh+gqOXaD1x1z oqZhJhgxb3AQfooNCFtMhvLRN+sTdsO068pMNGDh1/lfBWBRaYJL4Sw4QNkyipN6Frqi fxKtmJ+JElFb3EEPrBLFIpHhIsKupzUJHs+bt9t/AuFMlkY9CuomDfld9RJdWYHYuMvH EeErQePELMh4nnYkiwgTPjPQsiACnt7b6MG8WiF+tlzze7rLv1DEzIVj1Ogmz2xuv4L/ ZgxQ== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-filter; bh=ytV1hXsi6yCY6jSagexbs/gi9N3Tlue4dbEUj+BNvyY=; b=GzO2TEcYaqUNCSnwaIzQJZ0VFG5Mtj9sste37rofHcpLq61zntNhDuyg3qqN4JzO0T PP4vrbLEKiD+bxmNk8TlwlhWD+YX9n8GGkwZGhP4iL1TN4X2BgnBYE0rJMxFg3qomSpT o3yeJoSQ6xAlHnhEgIOJu5uskt1Epm4djacFfFNmBRt7BAG8bwiMFUkP4InnDBfjN5JL 7HTyTyIp/R39Y6bh7fvvMzSxM6SEZynUO/B6FayxBUK9EhzzLe8FRVsMH5azkVm7bzz/ +RRGBcMFKtfihb31+T/cRASmsmcpK5GsFiskCXrmp3DJBWqZ5EhNooM2I1XTFeXeVn2y EV2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Ux2uA+Kp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z10si443408plg.322.2022.02.09.15.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Ux2uA+Kp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9EB3AE0969A9; Wed, 9 Feb 2022 15:26:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233819AbiBIVrx (ORCPT + 99 others); Wed, 9 Feb 2022 16:47:53 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:59590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233801AbiBIVru (ORCPT ); Wed, 9 Feb 2022 16:47:50 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51B01C1DC2FD for ; Wed, 9 Feb 2022 13:47:52 -0800 (PST) Received: from [192.168.4.54] (cpe-70-95-196-11.san.res.rr.com [70.95.196.11]) by linux.microsoft.com (Postfix) with ESMTPSA id AD64920B9133; Wed, 9 Feb 2022 13:47:51 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AD64920B9133 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1644443271; bh=ytV1hXsi6yCY6jSagexbs/gi9N3Tlue4dbEUj+BNvyY=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=Ux2uA+KpylogqqibdjPbAEGu3pvyp0rpwP02e2ByJaPlisVc7Gr2S1ir4KLFQdJFP Z3QeskZ88vkYvJvSGalcJ9Z4YDJnG4Ouf/YbsmikuVIprGdNkU1rLJQNLuStzb5ZSe ILqe8lONrB+9KR6UBmeSCT/1N59Z8UuKULNF14Ls= Message-ID: <9436d033-579b-55fa-9b00-6f4b661c2dd7@linux.microsoft.com> Date: Wed, 9 Feb 2022 13:47:51 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [arm64] kernel boot slowdown in v5.10.19 -> v5.10.42 update Content-Language: en-US From: Vijay Balakrishna To: Catalin Marinas Cc: Linux kernel mailing list , linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne References: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> <7e43a7e9-f299-1d6d-8b61-425793abcc3e@linux.microsoft.com> In-Reply-To: <7e43a7e9-f299-1d6d-8b61-425793abcc3e@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/28/2022 10:03 AM, Vijay Balakrishna wrote: > > > On 1/28/2022 4:06 AM, Catalin Marinas wrote: >> On Mon, Jan 24, 2022 at 03:03:48PM -0800, Vijay Balakrishna wrote: >>> We noticed 150ms kernel boot slowdown back in June, 2021, when moving >>> from >>> v5.10.19 to v5.10.42.  This on a 8GB SoC.  Only recently we investigated >>> this issue and found the regression is introduced by a change in >>> map_mem() >>> (paging_init() -> map_mem() -> __map_memblock(), in particular "map >>> all the >>> memory banks" for loop) by patch >>> >>> 2687275a5843d1089687f08fc64eb3f3b026a169 >>> arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required >>> >>> above is a follow up to >>> >>> 0a30c53573b07d5561457e41fb0ab046cd857da5 >>> arm64: mm: Move reserve_crashkernel() into mem_init()) >>> >>> which deferred crashkernel reservation into mem_init(). >>> >>> The ~150ms slowdown disappears on booting without "crashkernel=.." on >>> kernel >>> command-line. >> >> Is CONFIG_RODATA_FULL_DEFAULT_ENABLED set in your config file? It may >> cause the same slowdown. I suspect it's because we end up mapping the >> RAM at the page granularity so more loops and slightly higher TLB >> pressure. Not sure we can do much about > > > Catalin, > > Thanks for your reply. > > CONFIG_RODATA_FULL_DEFAULT_ENABLED is not set in our config for boot > time performance reasons. From following patches, the main source of deferring crash kernel reservation is for Raspberry Pi 4, which has no IOMMU. 1a8e1cef7603e218339ac63cb3178b25554524e5 arm64: use both ZONE_DMA and ZONE_DMA32 8424ecdde7df99d5426e1a1fd9f0fb36f4183032 arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges 0a30c53573b07d5561457e41fb0ab046cd857da5 arm64: mm: Move reserve_crashkernel() into mem_init()) 2687275a5843d1089687f08fc64eb3f3b026a169 arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required However above changes introduced slow boot (regression) for platforms with IOMMU, for example as I mentioned earlier ~150ms for us. We don't have following configs set for our SoC -- # CONFIG_ZONE_DMA is not set # CONFIG_ZONE_DMA32 is not set Can we restore crash kernel reservation (no deferring to mem_init()) for platforms with no DMA memory zones? I can submit a patch. Thanks, Vijay