From patchwork Fri Apr 5 22:12:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 10887883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E00AF1390 for ; Fri, 5 Apr 2019 22:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C069B28A6E for ; Fri, 5 Apr 2019 22:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADBAA28A72; Fri, 5 Apr 2019 22:12:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E83328A6E for ; Fri, 5 Apr 2019 22:12:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 83FC321A07094; Fri, 5 Apr 2019 15:12:09 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=alexander.duyck@gmail.com; receiver=linux-nvdimm@lists.01.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D08CC21B02822 for ; Fri, 5 Apr 2019 15:12:08 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id v12so3766990pgq.1 for ; Fri, 05 Apr 2019 15:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=RFlyHVCvfroOhB2uXylkan752Y+bFRMjZlocuMb6szU=; b=b3nTx7+CUxVUlQscReM8Uk0JVZUKeHtdrGfJ+wUfk33PvUsvBzQAIzRc0Ik1qHli+/ zTx/G00PbwkkS0GfK1dhoOcSSY3F5ZNAqhIl5zI6blFbjIrCcDlPlYKyHamM5/T0GfJX RHUbjorVVLWuSmbEbsexEY6xUYeP0iGnIeMgZ8QDwGvBBm8SDRV2POijtZccOQP/ae7d pfq9ekZoa6baUfaKVE9wTeoBy1a/zegQwxayKkYT1XwadVo/t3hEXPUAaFlz/j3lM36W DD85qcu4vx4fHBvmm6bDEDvE7zIn1c3CpVX3eS2RVq5DdVpJj/zOzz8O3cKBug+QAMC4 JXQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=RFlyHVCvfroOhB2uXylkan752Y+bFRMjZlocuMb6szU=; b=e4BhfS9w8XB0eXaFQMA6/qvHQ5aj/ZemLXyT7ECrQRjxh8gIRYkvh6Nmd7Tp6/tpw3 IYWePIXjgpS/ZQZiTC4TY++ZDdNPIcHjWEHqruDZhNzOD5BiubePNMx8a/UW9h/L6NYM cMVfeTmqapbee7a7Z2aKZyHxTdwQfuLq3N1UrFKNeL09ZQ+OT2ecPLWjvttQtcABgYsZ 1HbjZlKWOsVMPrfjCz/zg9u8a7QeoRbrShbwEmW8qgTDJa0G7hfzzGWpbTxX3SF3O8jv TqYxQNTQIHRfCLjHQ61mTKK1N9YwddyRCt0YSIfIpKHmVP6Vk3gxVSZqdaIYHY1N5BLQ GkVg== X-Gm-Message-State: APjAAAU/KOzlE18NZv4yaYOW3LZdXzVxFViFRXdoahZTYJ6ov9R7de13 WliRbyjILDdhOz81NVg27wI= X-Google-Smtp-Source: APXvYqzcZRP6M2t/f+TFS8bfJasWfrNHx5XYhr8s6AbPgY9grB0g7CJ3SNDhP2NHNMThRf34AJUEoQ== X-Received: by 2002:aa7:82d6:: with SMTP id f22mr15222497pfn.190.1554502328079; Fri, 05 Apr 2019 15:12:08 -0700 (PDT) Received: from localhost.localdomain (50-126-100-225.drr01.csby.or.frontiernet.net. [50.126.100.225]) by smtp.gmail.com with ESMTPSA id q81sm42013500pfi.102.2019.04.05.15.12.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 15:12:07 -0700 (PDT) Subject: [mm PATCH v7 0/4] Deferred page init improvements From: Alexander Duyck To: linux-mm@kvack.org, akpm@linux-foundation.org Date: Fri, 05 Apr 2019 15:12:06 -0700 Message-ID: <20190405221043.12227.19679.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pavel.tatashin@microsoft.com, mhocko@suse.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, willy@infradead.org, davem@davemloft.net, khalid.aziz@oracle.com, rppt@linux.vnet.ibm.com, kirill.shutemov@linux.intel.com, sparclinux@vger.kernel.org, alexander.h.duyck@linux.intel.com, ldufour@linux.vnet.ibm.com, mgorman@techsingularity.net, mingo@kernel.org, vbabka@suse.cz Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP This patchset is essentially a refactor of the page initialization logic that is meant to provide for better code reuse while providing a significant improvement in deferred page initialization performance. In my testing on an x86_64 system with 384GB of RAM I have seen the following. In the case of regular memory initialization the deferred init time was decreased from 3.75s to 1.38s on average. This amounts to a 172% improvement for the deferred memory initialization performance. I have called out the improvement observed with each patch. v1->v2: Fixed build issue on PowerPC due to page struct size being 56 Added new patch that removed __SetPageReserved call for hotplug v2->v3: Rebased on latest linux-next Removed patch that had removed __SetPageReserved call from init Added patch that folded __SetPageReserved into set_page_links Tweaked __init_pageblock to use start_pfn to get section_nr instead of pfn v3->v4: Updated patch description and comments for mm_zero_struct_page patch Replaced "default" with "case 64" Removed #ifndef mm_zero_struct_page Fixed typo in comment that ommited "_from" in kerneldoc for iterator Added Reviewed-by for patches reviewed by Pavel Added Acked-by from Michal Hocko Added deferred init times for patches that affect init performance Swapped patches 5 & 6, pulled some code/comments from 4 into 5 v4->v5: Updated Acks/Reviewed-by Rebased on latest linux-next Split core bits of zone iterator patch from MAX_ORDER_NR_PAGES init v5->v6: Rebased on linux-next with previous v5 reverted Drop the "This patch" or "This change" from patch descriptions. Cleaned up patch descriptions for patches 3 & 4 Fixed kerneldoc for __next_mem_pfn_range_in_zone Updated several Reviewed-by, and incorporated suggestions from Pavel Added __init_single_page_nolru to patch 5 to consolidate code Refactored iterator in patch 7 and fixed several issues v6->v7: Updated MAX_ORDER_NR_PAGES patch to stop on section aligned boundaries Dropped patches 5-7 Will follow-up later with reserved bit rework before resubmitting --- Alexander Duyck (4): mm: Use mm_zero_struct_page from SPARC on all 64b architectures mm: Drop meminit_pfn_in_nid as it is redundant mm: Implement new zone specific memblock iterator mm: Initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections arch/sparc/include/asm/pgtable_64.h | 30 ----- include/linux/memblock.h | 41 +++++++ include/linux/mm.h | 41 ++++++- mm/memblock.c | 64 ++++++++++ mm/page_alloc.c | 218 ++++++++++++++++++++++------------- 5 files changed, 277 insertions(+), 117 deletions(-) --