From patchwork Thu Oct 11 22:13:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 10637521 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 14BB7157A for ; Thu, 11 Oct 2018 22:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F405B2C1FB for ; Thu, 11 Oct 2018 22:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E50E32C206; Thu, 11 Oct 2018 22:16:59 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C3382C1FB for ; Thu, 11 Oct 2018 22:16:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3C596B0003; Thu, 11 Oct 2018 18:16:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DEAE06B0006; Thu, 11 Oct 2018 18:16:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D01626B0007; Thu, 11 Oct 2018 18:16:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 94B0C6B0003 for ; Thu, 11 Oct 2018 18:16:57 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id a64-v6so9932757pfg.16 for ; Thu, 11 Oct 2018 15:16:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=pdfHqsyOIQQQ+YzjsoOaPBgG4CxT9KawRAPWq4S+gEI=; b=IXvJniLJ+9itWQcek4yeA9si8Ap60WeT6ddIT/Iyios8YsLRKHL3whOGc2PUSoYSG1 p4AVSEyOl0lbeCdhRFrW+sZKH4nQ6a79JL33aG3onZ70609pzBS+ZF1cTQBg3xoHayBY D0aFVTH+LwyvUQBXEf69dvDxr9Ew3RflILPnfl+35/LRdmcVfJuDxELBGN6gukc2OHol j2Zg2yzffLCVh4nZw3yr8En0UuXu34zFFxPTicBUfRt4lY/XrOPGP5qibawbOQC4XLD3 vHMAbR6tsPOoM79LWdO5JxENMTIGeeIbL7suzr5NnzZQGJgRmYV1z29oNhH1rzAuZ7F1 8MzA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=alexander.h.duyck@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: ABuFfoiodV/w5HV6ztUQ7Znvly2rc4YvGMKso81YWeO4TDFU8KssdoPF dJ9pVhDx6ncEXQaOCXTsrv9OqeLUfmzHsXg7hN7L0g0v4Ux50YH09nYFy68aq/nUk9qZEpNTLIF ixBjl67fauAfccnDXlLL5VaRmnesFEyXKFxMFniCW3OGeGRbXTQ5wxQMhGrc85kG3KA== X-Received: by 2002:a17:902:3a2:: with SMTP id d31-v6mr3251605pld.287.1539296217280; Thu, 11 Oct 2018 15:16:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV62m6RGRXBFuMY3HnzN6b0+lGV/AYRVr0CvL9DT+lF8lvWpuORNvi5Y9YuxN4qIcHuXuuPHv X-Received: by 2002:a17:902:3a2:: with SMTP id d31-v6mr3251548pld.287.1539296216148; Thu, 11 Oct 2018 15:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539296216; cv=none; d=google.com; s=arc-20160816; b=zgf2f6bQ7rmIB2qvgfUnKoGxpG37Lh+b0BxTEBlKMKK2WTMpzHoqkG613SDjaNHbvP MFP8D9W1a9A01xIiHADxKwiod1oJ9p/eaMO/ZbF4FF4dorHoU9jSjpa/bNYURkiWPXsi R7JYX2IHfTBKmZ1xTl9LMv/Mlj7/GTpCmQqQchUKxv5+rBebA7+HICea19udSaYT9srl eEx7J4C6dfvN7pB5ILtoq1MfyOzzuJ5LQzQh57yuvI/dDSTRuT5S0JG4nVj0T1QoT0Dv hbWvNnMmCatsffhCV5pWap27H+wLDkw27PHf7muT25FdZrOGC2aajkqIgdY71e2bmZrS sJUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:message-id:date :cc:to:from:subject; bh=pdfHqsyOIQQQ+YzjsoOaPBgG4CxT9KawRAPWq4S+gEI=; b=famCCPho3ihHKzM/IL/LvOnpxggxm276plP/IBwTnRyGwTkT90yzVDHwCAFy3YGZbY QgDXH/1uYDNJVf1KtyUO9Ivume/3hSuLwIsOEdQCyD+jY1C6fy2mkwKxEdBRbRlHNj8k 6NafsvhACPQllmUrfiKiXNmVJf2xjGVFj6Z/4G2kUCdFp+hdC+pKqdSFci6lKHGZ2KbN iJCaYZSytztospuBMpx8riOhgwMmqwyE05batD1PhzwAKNzT+V33mMgtyDe0xQlnFyxt s4TaPYitsuGIM0/6EkaQM9g2wtEteWaNJK8I0nz3xyQmQVG1jNB0EtJIp4MctYtheq/o nVQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=alexander.h.duyck@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga18.intel.com (mga18.intel.com. [134.134.136.126]) by mx.google.com with ESMTPS id r29-v6si24916614pff.262.2018.10.11.15.16.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Oct 2018 15:16:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 134.134.136.126 as permitted sender) client-ip=134.134.136.126; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=alexander.h.duyck@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 15:16:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,370,1534834800"; d="scan'208";a="80765696" Received: from ahduyck-mobl.amr.corp.intel.com (HELO localhost.localdomain) ([10.7.198.157]) by orsmga008.jf.intel.com with ESMTP; 11 Oct 2018 15:13:28 -0700 Subject: [mm PATCH v2 0/6] Deferred page init improvements From: Alexander Duyck To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: pavel.tatashin@microsoft.com, mhocko@suse.com, dave.jiang@intel.com, alexander.h.duyck@linux.intel.com, linux-kernel@vger.kernel.org, willy@infradead.org, davem@davemloft.net, yi.z.zhang@linux.intel.com, khalid.aziz@oracle.com, rppt@linux.vnet.ibm.com, vbabka@suse.cz, sparclinux@vger.kernel.org, dan.j.williams@intel.com, ldufour@linux.vnet.ibm.com, mgorman@techsingularity.net, mingo@kernel.org, kirill.shutemov@linux.intel.com Date: Thu, 11 Oct 2018 15:13:28 -0700 Message-ID: <20181011221237.1925.85591.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 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: 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 I have seen a 60% reduction in the time needed for deferred memory initialization on two different x86_64 based test systems I have. In addition this provides a very slight improvement for the hotplug memory initialization, although the improvement doesn't exceed 5% from what I can tell and that is to be expected since most of the changes related to hotplug init are mostly just code clean-up to allow for reuse. The biggest gains of this patchset come from not having to test each pfn multiple times to see if it is valid and if it is actually a part of the node being initialized. v1->v2: Fixed build issue on PowerPC due to page struct size being 56 Added new patch that removed __SetPageReserved call for hotplug --- Alexander Duyck (6): mm: Use mm_zero_struct_page from SPARC on all 64b architectures mm: Drop meminit_pfn_in_nid as it is redundant mm: Use memblock/zone specific iterator for handling deferred page init mm: Do not set reserved flag for hotplug memory mm: Move hot-plug specific memory init into separate functions and optimize mm: Use common iterator for deferred_init_pages and deferred_free_pages arch/sparc/include/asm/pgtable_64.h | 30 -- include/linux/memblock.h | 58 ++++ include/linux/mm.h | 34 ++ mm/memblock.c | 63 ++++ mm/page_alloc.c | 552 +++++++++++++++++++++-------------- 5 files changed, 483 insertions(+), 254 deletions(-) --