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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2BF3C433E0 for ; Wed, 23 Dec 2020 08:08:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 177C8207D0 for ; Wed, 23 Dec 2020 08:08:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 177C8207D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 367E38D001A; Wed, 23 Dec 2020 03:08:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 318E28D0015; Wed, 23 Dec 2020 03:08:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22F068D001A; Wed, 23 Dec 2020 03:08:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 0A8F18D0015 for ; Wed, 23 Dec 2020 03:08:25 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C8D673638 for ; Wed, 23 Dec 2020 08:08:24 +0000 (UTC) X-FDA: 77623819728.01.wax88_5910abb27467 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id A3D2A10045EE4 for ; Wed, 23 Dec 2020 08:08:24 +0000 (UTC) X-HE-Tag: wax88_5910abb27467 X-Filterd-Recvd-Size: 5184 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Dec 2020 08:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608710903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=X+E4mOCbGmFY6qa2D9l+paxorGnjOvKByACYD2gWYp4=; b=UDKkwZEixVIl6EwtjDtNeJQ6fHqMd/INzz8OMYdaDl9YVmsvbOeG+HZgXHhhK3hnmuIstn ek5HEuA3gNKgn2xDYy6EqPgWrKROB6H1Myh4pvYinOPSZclPolYpPwP8rgnZIgmsK24rTI ric61QWNUZP7r4IZGLsRZ1YPk3Auv+o= 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-468-6olFiZpQM5m1XhotItqKMA-1; Wed, 23 Dec 2020 03:08:19 -0500 X-MC-Unique: 6olFiZpQM5m1XhotItqKMA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EC0D8049C0; Wed, 23 Dec 2020 08:08:18 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-111.pek2.redhat.com [10.72.13.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87E1C5D9CC; Wed, 23 Dec 2020 08:08:12 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, gopakumarr@vmware.com, rppt@kernel.org, david@redhat.com, bhe@redhat.com Subject: [PATCH v3 0/1] mm: memmap defer init dosn't work as expected Date: Wed, 23 Dec 2020 16:08:10 +0800 Message-Id: <20201223080811.16211-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Post the regression fix in a standalone patch as Andrew suggested for -stable branch better back porting. This is rebased on the latest master branch of mainline kenrel, surely there's almost no change comparing with v2. https://lore.kernel.org/linux-mm/20201220082754.6900-1-bhe@redhat.com/ Tested on a system with 24G ram as below, adding 'memmap=128M!0x500000000' to split the one ram region into two regions in numa node1 to simulate the scenario of VMware. [ +0.000000] BIOS-provided physical RAM map: [ +0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009bfff] usable [ +0.000000] BIOS-e820: [mem 0x000000000009c000-0x000000000009ffff] reserved [ +0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved [ +0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000006cdcefff] usable [ +0.000000] BIOS-e820: [mem 0x000000006cdcf000-0x000000006efcefff] reserved [ +0.000000] BIOS-e820: [mem 0x000000006efcf000-0x000000006fdfefff] ACPI NVS [ +0.000000] BIOS-e820: [mem 0x000000006fdff000-0x000000006fffefff] ACPI data [ +0.000000] BIOS-e820: [mem 0x000000006ffff000-0x000000006fffffff] usable [ +0.000000] BIOS-e820: [mem 0x0000000070000000-0x000000008fffffff] reserved [ +0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000ffffffff] reserved [ +0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000067f1fffff] usable [ +0.000000] BIOS-e820: [mem 0x000000067f200000-0x000000067fffffff] reserved Test passed as below. As you can see, with patch applied, memmap init will cost much less time on numa node 1: Without the patch: [ 0.065029] Early memory node ranges [ 0.065030] node 0: [mem 0x0000000000001000-0x000000000009bfff] [ 0.065032] node 0: [mem 0x0000000000100000-0x000000006cdcefff] [ 0.065034] node 0: [mem 0x000000006ffff000-0x000000006fffffff] [ 0.065036] node 0: [mem 0x0000000100000000-0x000000027fffffff] [ 0.065038] node 1: [mem 0x0000000280000000-0x00000004ffffffff] [ 0.065040] node 1: [mem 0x0000000508000000-0x000000067f1fffff] [ 0.065185] Zeroed struct page in unavailable ranges: 16533 pages [ 0.065187] Initmem setup node 0 [mem 0x0000000000001000-0x000000027fffffff] [ 0.069616] Initmem setup node 1 [mem 0x0000000280000000-0x000000067f1fffff] [ 0.096298] ACPI: PM-Timer IO Port: 0x408 With the patch applied: [ 0.065029] Early memory node ranges [ 0.065030] node 0: [mem 0x0000000000001000-0x000000000009bfff] [ 0.065032] node 0: [mem 0x0000000000100000-0x000000006cdcefff] [ 0.065034] node 0: [mem 0x000000006ffff000-0x000000006fffffff] [ 0.065036] node 0: [mem 0x0000000100000000-0x000000027fffffff] [ 0.065038] node 1: [mem 0x0000000280000000-0x00000004ffffffff] [ 0.065041] node 1: [mem 0x0000000508000000-0x000000067f1fffff] [ 0.065187] Zeroed struct page in unavailable ranges: 16533 pages [ 0.065189] Initmem setup node 0 [mem 0x0000000000001000-0x000000027fffffff] [ 0.069572] Initmem setup node 1 [mem 0x0000000280000000-0x000000067f1fffff] [ 0.070161] ACPI: PM-Timer IO Port: 0x408 Baoquan He (1): mm: memmap defer init dosn't work as expected arch/ia64/mm/init.c | 4 ++-- include/linux/mm.h | 5 +++-- mm/memory_hotplug.c | 2 +- mm/page_alloc.c | 8 +++++--- 4 files changed, 11 insertions(+), 8 deletions(-) -- 2.17.2