Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3703512pxb; Mon, 24 Jan 2022 15:50:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZTY7HR7s4yqefQ+YWQtOSJ2kbFUKrY8N6dBzlN9UvqfGzQ+f/7bdyytF/s78bdCR4jDTC X-Received: by 2002:a17:903:22ca:b0:14b:3bbd:82ed with SMTP id y10-20020a17090322ca00b0014b3bbd82edmr9828984plg.37.1643068115403; Mon, 24 Jan 2022 15:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068115; cv=none; d=google.com; s=arc-20160816; b=P1FRLYFCojhUuTUqm5fqvQog1s3siZzJ1P826iE+ff8w3ejz4ZeeXCHx9iWYjMjapF iAPXuCbuojUlU+Yi/KCktVDTBZdvN855SAkFQz0FO2SEoHuEOJkXJ1InhKUcn7reMsna 2lXlPDwv81YYu3r7/bT9xy1V2M5jK8OdE7ttQ8J8ERrkJiaxmc5qKhcGm5ZQq6LKN395 BiCrWSATFmuxWhO8zZJ33XsPt/P8YK5iQ72HRwjnIYZ2n0o2b9Zu/2wrramEB1/FJ2bQ n/y92g6P3MbpZed3+Bqwa0u0LEPRtKGgn5Vo1IwiYBTc6pTPM+dQDh9hJCgp49nG18LQ Utiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:user-agent:mime-version:date:message-id:dkim-signature :dkim-filter; bh=erMbjM3XkmJLfKK8q0n5yEgsEAAwonKLOKfoVw5HxBQ=; b=CmkFThNfOR0dqJb8/lGjtj4d6csKkuXYzobY/nqd84bfntshdmwpxQhw9T8cKPL+Tt M+uRWAiSRMKhCQ5+LkndlIpsdQAaV/ftK/CM45Y84Jv5xaT+5w9J5/aXlSOsEiou0lVI ivpY99JgMSBt96218Oto76vaPipr/OWAD6LNZeykA+vkrid8ETmc4yOg9BPutFx62uLQ yxnCLu/T3r0TN1Aq4CWBgml/oXghZrOrAKB0RC+1PU0vhJUMYjdcq55BhkvliTcXVmzO GMI1knZT+FzVPH8clTQiFwuzMATbY0HmQiqnCaCzIuw6/mE3QSl7Ub05qJZ/uT3xaD7Q OWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=rCaPyArv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si623045pjb.70.2022.01.24.15.48.22; Mon, 24 Jan 2022 15:48:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=rCaPyArv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2362377AbiAXXmS (ORCPT + 99 others); Mon, 24 Jan 2022 18:42:18 -0500 Received: from linux.microsoft.com ([13.77.154.182]:41238 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1843329AbiAXXDu (ORCPT ); Mon, 24 Jan 2022 18:03:50 -0500 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 6612120B6C61; Mon, 24 Jan 2022 15:03:49 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6612120B6C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1643065429; bh=erMbjM3XkmJLfKK8q0n5yEgsEAAwonKLOKfoVw5HxBQ=; h=Date:From:Subject:To:Cc:From; b=rCaPyArv7JzRk2A/NuDnfWI2VZX4LncAbOSOc1SI6p05uHnxI6WXtV0O4Hyh38cp7 dEQ+9Gr3ZdVlZcsQLrMmFpAQrON9wMRuQ2jG+GiCmANhIrRa9c0x8hhksAQbqMScvl vb9wZ8vuVEXMM+uhpwf778/GWvFxxV2L4ch135zU= Message-ID: <9a34ee9b-0ede-30a6-0898-d32fe81d5b0c@linux.microsoft.com> Date: Mon, 24 Jan 2022 15:03:48 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Vijay Balakrishna Subject: [arm64] kernel boot slowdown in v5.10.19 -> v5.10.42 update To: Nicolas Saenz Julienne , Catalin Marinas Cc: Linux kernel mailing list , linux-arm-kernel@lists.infradead.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Please let us know if it known/understood or addressed already or being looked into. Any insight is appreciated. Thanks, Vijay console output collected with debug prints -- [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083] [ 0.000000] Linux version 5.10.42.6-xxx-standard-2008.3.0-local-snapshot-01210432 (oe-user@oe-host) (clang version 10.[ 0.000001] sched_clock: 64 bits at 125MHz, resolution 8ns, wraps every 4398046511100ns [ 0.000003] 2.560781952 MSFT: kernel boot start [ 0.000484] Machine model: xxx [ 0.009379] earlycon: uart8250 at MMIO32 0x0000000068a10000 (options '') [ 0.009383] printk: bootconsole [uart8250] enabled [ 0.009828] before paging_init() [ 0.009977] before map_mem() [ 0.009978] after memblock_mark_nomap() [ 0.152388] after __map_memblock() for loop [ 0.152391] after __map_memblock() kernel_start, kernel_end [ 0.152393] after memblock_clear_nomap [ 0.152394] after map_mem() [ 0.152401] after paging_init() [ 0.153273] NUMA: No NUMA configuration found [ 0.153278] NUMA: Faking a node at [mem 0x0000000080000000-0x000000097fffffff] [ 0.153282] NUMA: NODE_DATA [mem 0x97efec5c0-0x97efedfff] [ 0.153316] Zone ranges: [ 0.153319] Normal [mem 0x0000000080000000-0x000000097fffffff] [ 0.153323] Device empty [ 0.153325] Movable zone start for each node [ 0.153326] Early memory node ranges [ 0.153328] node 0: [mem 0x0000000080000000-0x000000008adfffff] [ 0.153330] node 0: [mem 0x000000008ae00000-0x000000008f223fff] [ 0.153331] node 0: [mem 0x000000008f224000-0x00000000ffffffff] [ 0.153333] node 0: [mem 0x0000000880000000-0x00000008800fffff] [ 0.153334] node 0: [mem 0x0000000880100000-0x000000097fffffff] [ 0.153337] Initmem setup node 0 [mem 0x0000000080000000-0x000000097fffffff] [ 0.153340] On node 0 totalpages: 1572864 [ 0.153342] Normal zone: 24576 pages used for memmap [ 0.153343] Normal zone: 0 pages reserved [ 0.153345] Normal zone: 1572864 pages, LIFO batch:63 [ 0.154507] crashkernel reserved: 0x0000000968e00000 - 0x0000000978e00000 (256 MB) Console output from PXE boot without "crashkernel=256M" boot parameter -- [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083] [ 0.000000] Linux version 5.10.42.6-xxx-standard-2008.3.0-local-snapshot-01210432 (oe-user@oe-host) (clang version 10.[ 0.000001] sched_clock: 64 bits at 125MHz, resolution 8ns, wraps every 4398046511100ns [ 0.000003] 14.765446920 MSFT: kernel boot start [ 0.000484] Machine model: xxx [ 0.009400] earlycon: uart8250 at MMIO32 0x0000000068a10000 (options '') [ 0.009404] printk: bootconsole [uart8250] enabled [ 0.009835] before paging_init() [ 0.009986] before map_mem() [ 0.009987] after memblock_mark_nomap() [ 0.010154] after __map_memblock() for loop [ 0.010156] after __map_memblock() kernel_start, kernel_end [ 0.010158] after memblock_clear_nomap [ 0.010159] after map_mem() [ 0.010163] after paging_init() [ 0.011002] NUMA: No NUMA configuration found [ 0.011005] NUMA: Faking a node at [mem 0x0000000080000000-0x000000097fffffff] [ 0.011009] NUMA: NODE_DATA [mem 0x97fbc65c0-0x97fbc7fff] [ 0.011037] Zone ranges: [ 0.011038] Normal [mem 0x0000000080000000-0x000000097fffffff] [ 0.011041] Device empty [ 0.011043] Movable zone start for each node [ 0.011044] Early memory node ranges [ 0.011046] node 0: [mem 0x0000000080000000-0x000000008adfffff] [ 0.011048] node 0: [mem 0x000000008ae00000-0x000000008f223fff] [ 0.011049] node 0: [mem 0x000000008f224000-0x00000000ffffffff] [ 0.011050] node 0: [mem 0x0000000880000000-0x00000008800fffff] [ 0.011052] node 0: [mem 0x0000000880100000-0x000000097fffffff] [ 0.011054] Initmem setup node 0 [mem 0x0000000080000000-0x000000097fffffff] [ 0.011056] On node 0 totalpages: 1572864 [ 0.011058] Normal zone: 24576 pages used for memmap [ 0.011060] Normal zone: 0 pages reserved [ 0.011061] Normal zone: 1572864 pages, LIFO batch:63