From patchwork Sun Dec 13 15:09:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11970813 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 28DC6C4361B for ; Sun, 13 Dec 2020 15:09:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A172D23121 for ; Sun, 13 Dec 2020 15:09:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A172D23121 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 066166B005C; Sun, 13 Dec 2020 10:09:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0155D6B005D; Sun, 13 Dec 2020 10:09:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6E136B0068; Sun, 13 Dec 2020 10:09:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id CEF7D6B005C for ; Sun, 13 Dec 2020 10:09:57 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 96CC22464 for ; Sun, 13 Dec 2020 15:09:57 +0000 (UTC) X-FDA: 77588594034.29.cause27_39181a627413 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 76948180868F0 for ; Sun, 13 Dec 2020 15:09:57 +0000 (UTC) X-HE-Tag: cause27_39181a627413 X-Filterd-Recvd-Size: 3118 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Sun, 13 Dec 2020 15:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607872195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=UIPal/iSZ9+R48jbZZ5wjjvQIt/y+OdbRYPpNTUIVyo=; b=CbbxM2vsoE/venrmNG6dWTwi9CRN9vr1ebTBsUYTIltD4klgt8G5ouQChwRkekS2OS1uIo 9zWbKBnIwwF9/lC38Sk9bFJZsbHZNXzTnW4I5TI+qU0j+m5CXvZQ29fmmolwrK8BeezyI3 4ulc9mtIOqLn/2OLf9bDvr0ePT1RZ5o= 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-29-WRlB6oiHNnehtBfWXj6Auw-1; Sun, 13 Dec 2020 10:09:51 -0500 X-MC-Unique: WRlB6oiHNnehtBfWXj6Auw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FA2B107ACE3; Sun, 13 Dec 2020 15:09:49 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-67.pek2.redhat.com [10.72.12.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id A76BF1F45B; Sun, 13 Dec 2020 15:09:44 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, gopakumarr@vmware.com, akpm@linux-foundation.org, rppt@kernel.org, natechancellor@gmail.com, ndesaulniers@google.com, clang-built-linux@googlegroups.com, rostedt@goodmis.org, manir@vmware.com, lauyiuch@vmware.com, pjonasson@vmware.com, rajaramv@vmware.com Subject: [PATCH 0/2] Fix the incorrect memmap init defer handling Date: Sun, 13 Dec 2020 23:09:40 +0800 Message-Id: <20201213150942.20990-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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: VMware reported the performance regression during memmap_init() invocation. And they bisected to commit 73a6e474cb376 ("mm: memmap_init: iterate over memblock regions rather that check each PFN") causing it. After investigation, it's caused by incorrect memmap init defer handling in memmap_init_zone() after commit 73a6e474cb376. The current memmap_init_zone() only handle one memory region of one zone, while memmap_init() iterates over all its memory regions and pass them one by one into memmap_init_zone() to handle. So in this patchset, patch 1/2 fixes the bug observed by VMware. Patch 2/2 clean up the inappropriate name of memmap_init(), memmap_init_zone() accordingly. VMware helped do the testing on their VMware ESI platform. This patchset is based on 5.10.0-rc7+, master branch of Linus's tree. Baoquan He (2): mm: memmap defer init dosn't work as expected mm: rename memmap_init() and memmap_init_zone() arch/ia64/mm/init.c | 8 ++++---- include/linux/mm.h | 5 +++-- mm/memory_hotplug.c | 2 +- mm/page_alloc.c | 22 ++++++++++++---------- 4 files changed, 20 insertions(+), 17 deletions(-)