From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EE5AC433F5 for ; Fri, 28 Jan 2022 12:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348274AbiA1MGW (ORCPT ); Fri, 28 Jan 2022 07:06:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242285AbiA1MGU (ORCPT ); Fri, 28 Jan 2022 07:06:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F5AC061714 for ; Fri, 28 Jan 2022 04:06:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6D44561AB8 for ; Fri, 28 Jan 2022 12:06:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E625DC340E0; Fri, 28 Jan 2022 12:06:18 +0000 (UTC) Date: Fri, 28 Jan 2022 12:06:15 +0000 From: Catalin Marinas To: Vijay Balakrishna Cc: Nicolas Saenz Julienne , Linux kernel mailing list , linux-arm-kernel@lists.infradead.org Subject: Re: [arm64] kernel boot slowdown in v5.10.19 -> v5.10.42 update Message-ID: References: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C45B2C433F5 for ; Fri, 28 Jan 2022 12:07:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BaEYh/I8Nz71TagBskTvbHs+zZwxxB2YNHjdMww8pxk=; b=NCSFuNvRlz9puF st9GgGbIX8Ne+5bxWEppkvNbdstdz+KDBcSX2Qajx2T5bizOax/YTRTHLt02B4hejlByzAC81atPK 8xpiPdczCsf3PW3Pgszpd/CMpWddyvICorYaQydo08pFijKkaTYRTGTvrmk7+QQu9nxJcpbx+xBMe PXaA9ySyeg1mhHxGn194B1QgBdsUtz7j/dX15kyss4uf0gERPvVHxWx60dXmEHFcuRg1f8Y4f74WK HPC0jW31VFXGOdue8KSV/CGQWmWeeVc7NemyTKv6kq76ALb/dppf67AHNDWewXl8p01EP7yWXcVBC GB2JvwbnNKYBp4mgnb8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDQ1K-001ojY-Jr; Fri, 28 Jan 2022 12:06:26 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDQ1F-001oiW-8F for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 12:06:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61EDD61A8D; Fri, 28 Jan 2022 12:06:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E625DC340E0; Fri, 28 Jan 2022 12:06:18 +0000 (UTC) Date: Fri, 28 Jan 2022 12:06:15 +0000 From: Catalin Marinas To: Vijay Balakrishna Cc: Nicolas Saenz Julienne , Linux kernel mailing list , linux-arm-kernel@lists.infradead.org Subject: Re: [arm64] kernel boot slowdown in v5.10.19 -> v5.10.42 update Message-ID: References: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_040621_354475_B2CCB28D X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel