Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2623950pxu; Sat, 10 Oct 2020 01:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+9LXZwf/KW+PuUPAtyLFAqxIHmgQKvStj6n9zHwkN+hOI4VvcIqmr/6FOJKrcr2NMAxTH X-Received: by 2002:a05:6402:c84:: with SMTP id cm4mr3472692edb.270.1602319553619; Sat, 10 Oct 2020 01:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602319553; cv=none; d=google.com; s=arc-20160816; b=pvfWvUXB/+TA8Ms8tcP8UxLeK1XyuCyY+Lua4arAvRF3wCpKKW5OesCqDfH9AeEr3v azvpDHVyK4yS+80ynDcuQRn63WICPowpKHQ5bf5ZeG1b4L71IUsVpp3RLGFVLukgRq9l s2Qa9iAv4cHNWdO3g+RM0WSP9kpVnj+OsBmThBvEQweHOD1SdgASkoFGJbdbslzG6c9s 7gDkRDn8CnuADgVX2K5dHvH+V/ldMWu+H/6xeZFWf1DWjAhVifLvwE+9XWk/zMwEVYwn x7QytIDSmpnxUNSaOWFg/S7SLfcFcfWiy0G25ygAOIIpjnFmIiNMCWa18No9R6ionTe5 8aQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IyGrTsuf+XbfRsOlZleQ8COsqo+RgEPBV6+boXBhvfA=; b=Z5wgQln3jYj6f9MDtMzwVBc1WLDy6aryP1t3X3AY0dpIJFPM1jIIYCEPdqfeN8DFUs 80jfu0Kpi1x5As9IvGwyknXZwMH2qcfbMAbKxxPTaRcXM1HK3t++MvONf/hKDWEIWPvd 49pEIHkyo1q/zz+edxxXmAAqYL23yE4I/LETymy3Yw1MorhfvBVhCnZXgC1OKDvFm9yR RisV9MLtYkmixf23fVgnEZytq6dJKUBmRuXdC91t0eHfqZjfVjeSF25WZisia7ck1sqm /5kDoNn0Tp6ZIdF5dtzFbxearHywSyDPtiROqyrcKTq2bSYjpGv4YEUzyFqAN+ubA7lZ UTcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aco4i24u; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si7797380edd.517.2020.10.10.01.45.30; Sat, 10 Oct 2020 01:45:53 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=aco4i24u; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726058AbgJJGLl (ORCPT + 99 others); Sat, 10 Oct 2020 02:11:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20022 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgJJGLe (ORCPT ); Sat, 10 Oct 2020 02:11:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602310293; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IyGrTsuf+XbfRsOlZleQ8COsqo+RgEPBV6+boXBhvfA=; b=aco4i24upY52szACRORitb5ZYJflYxEqzQSQBmIpF3x+yzP/5+6wkxmXvS6HQybD/qO/yZ 7MrfZeQQhjkcpKjK2NcGBumMqWBhu5WBk+zGMc3Q7AAepFqSI+UdxU46KVDknR/S1nvUMb XjQ778oWLPpPfTdo76vaNg2kAWTNx8M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-pc0cwYiJO-e5uiA-NDu72g-1; Sat, 10 Oct 2020 02:11:30 -0400 X-MC-Unique: pc0cwYiJO-e5uiA-NDu72g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3DEFF186DD23; Sat, 10 Oct 2020 06:11:28 +0000 (UTC) Received: from localhost (ovpn-12-89.pek2.redhat.com [10.72.12.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19F4D10013C1; Sat, 10 Oct 2020 06:11:26 +0000 (UTC) Date: Sat, 10 Oct 2020 14:11:24 +0800 From: "bhe@redhat.com" To: Rahul Gopakumar Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "natechancellor@gmail.com" , "ndesaulniers@google.com" , "clang-built-linux@googlegroups.com" , "rostedt@goodmis.org" , Rajender M , Yiu Cho Lau , Peter Jonasson , Venkatesh Rajaram Subject: Re: Performance regressions in "boot_time" tests in Linux 5.8 Kernel Message-ID: <20201010061124.GE25604@MiWiFi-R3L-srv> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/20 at 01:15pm, Rahul Gopakumar wrote: > As part of VMware's performance regression testing for Linux Kernel > upstream releases, we identified boot time increase when comparing > Linux 5.8 kernel against Linux 5.7 kernel. Increase in boot time is > noticeable on VM with a **large amount of memory**. >   > In our test cases, it's noticeable with memory 1TB and more, whereas > there was no major difference noticed in testcases with <1TB. >   > On bisecting between 5.7 and 5.8, we found the following commit from  > “Baoquan He” to be the cause of boot time increase in big VM test cases. >   > ------------------------------------- >   > commit 73a6e474cb376921a311786652782155eac2fdf0 > Author: Baoquan He > Date: Wed Jun 3 15:57:55 2020 -0700 >   > mm: memmap_init: iterate over memblock regions rather that check each PFN >   > When called during boot the memmap_init_zone() function checks if each PFN > is valid and actually belongs to the node being initialized using > early_pfn_valid() and early_pfn_in_nid(). >   > Each such check may cost up to O(log(n)) where n is the number of memory > banks, so for large amount of memory overall time spent in early_pfn*() > becomes substantial. >   > ------------------------------------- >   > For boot time test, we used RHEL 8.1 as the guest OS. > VM config is 84 vcpu and 1TB vRAM. >   > Here are the actual performance numbers. >   > 5.7 GA - 18.17 secs > Baoquan's commit - 21.6 secs (-16% increase in time) >   > From dmesg logs, we can see significant time delay around memmap. >   > Refer below logs. >   > Good commit >   > [0.033176] Normal zone: 1445888 pages used for memmap > [0.033176] Normal zone: 89391104 pages, LIFO batch:63 > [0.035851] ACPI: PM-Timer IO Port: 0x448 >   > Problem commit >   > [0.026874] Normal zone: 1445888 pages used for memmap > [0.026875] Normal zone: 89391104 pages, LIFO batch:63 > [2.028450] ACPI: PM-Timer IO Port: 0x448 Could you add memblock=debug to kernel cmdline and paste the boot logs of system w and w/o the commit? >   > We did some analysis, and it looks like with the problem commit it's > not deferring the memory initialization to a later stage and it's > initializing the huge chunk of memory in serial - during the boot-up > time.  Whereas with the good commit, it was able to defer the > initialization of the memory when it could be done in parallel. > > > Rahul Gopakumar > Performance Engineering > VMware, Inc. >