From patchwork Fri Oct 5 15:11:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 10628287 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 4049A112B for ; Fri, 5 Oct 2018 15:12:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E622976F for ; Fri, 5 Oct 2018 15:12:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25F9829807; Fri, 5 Oct 2018 15:12:03 +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 A346429771 for ; Fri, 5 Oct 2018 15:12:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FE8B6B0010; Fri, 5 Oct 2018 11:12:01 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 587356B0266; Fri, 5 Oct 2018 11:12:01 -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 429306B0269; Fri, 5 Oct 2018 11:12:01 -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 006426B0010 for ; Fri, 5 Oct 2018 11:12:01 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id r81-v6so9122907pfk.11 for ; Fri, 05 Oct 2018 08:12:00 -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=UJhgTnaRk+wpHJBwxlHF+XSJaHCHi3gA4saUbelqJP4=; b=eZTzOwtT/0thSaD/SRuO4JF7bnvS25gAfRIQZz95rhPpuPVkKENVb6ek/zBX456GUK 97KtAxKz0sTU9TYaS5kOIuSzZdFrd19Rp1OOwEdpwHdFw2bDxFnlrKvWEX7lG8cSxSSu 7wVh1X7kvoqUq/KW1j1WrKcUD7B6LPm1VbIdvPqWF6b/eZJMv80Lpw5lOPXthaQVeFDx ESJqriV1BZ9KWropnpOTBC4W0q6Ku0NXu5Cbh6G8zsmxZ4HabM+sgMs3OUwgODn8Tzvb s9YYsw+jHQYWygEsgFd4L5enPEX7iC15yz8ZvdQB2PRWfzxBraVFjkUgjcq1/tFlaKmY SpYQ== 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.100 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: ABuFfojwaUbwvH2X5NnbdhhSASiql0mXQCTJ93keCx2LAt1HvcZXC40o rb8RGw0g9G7KBfF/7QdVwoMS4JphqW86gLhPTSvFPW2N+G7hGFsMLa16y52en8QfPc6MKm+s4x3 K3E8gX81XVJISaCXtFHU1kDm1HIFsG5xXZGa4zKhZQyDeiwWhzxdUTdPmkFfX0BzJMw== X-Received: by 2002:a63:6c4a:: with SMTP id h71-v6mr9442241pgc.326.1538752320673; Fri, 05 Oct 2018 08:12:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QJptFUJUePOEBQX9RuBsraC68iDGM/q/oa/0mHfoCOW1VwXXJELDLs6Ev8V/hlskc7UYq X-Received: by 2002:a63:6c4a:: with SMTP id h71-v6mr9442185pgc.326.1538752319915; Fri, 05 Oct 2018 08:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538752319; cv=none; d=google.com; s=arc-20160816; b=shHy58/2BHgeXFwUeL20t4Sqeq6WhMQmP0hPkDqjO1LAt8IjfgeStkn/yh5Xyzwj+d VdjOu9UqEqU8Uyv0FjDuk4L1PmY6lTsP+0lq9FFmkYZJFR71V5okZo/BeIwxv86M31ja x0BJ/S61f06D4g1o8qqGLfGLOsMTwqFaf3YMTPGfLgmk4/rRTyo7mg3zRp9eN08kNPYk fXQEyX6h9UBuLM75xU4k8tWmzhHhla65WOy/9h4iaUy3HroHMx4L4CmN3Aap3aiBJPBY +H/lqZr/6UQmd1rl0Wbl/gUGjh/uCVQ+sbCaap+aHloqeMxo9rofMrmI5BSFYxSd/sPY IVfw== 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=UJhgTnaRk+wpHJBwxlHF+XSJaHCHi3gA4saUbelqJP4=; b=U34eXhH/qj/13rvz2tG2vwURxi7WjgaQuHRIF4A8nwtfxBgyThHyWPfrp/sShs+V9T S5lH1jcQgnOK6eLRiybFUm2XY0kU0uBOF4WmSr0GdLhakOPt8kmtUHvaHRMNETtM87cn f5luKpG8WGz7nySxSx09edIkqSsnnhJnw9r3OzjZUH+2aNb1DXh+XBZXuWywxDnzrobg QLjeNXfOvbfnrJkPoVbhSyD/jsWv3BzAvjdhNrgnCZRoQHSPtgXlibes9zBFQh6aGYwp WFOMKEPWV7bpybx6LnNGR8ag+Xo+aSeKrhvsb3V3c4Hqi8XJ7eryywZUZm5PFiCN7RVK QM4w== 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.100 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 mga07.intel.com (mga07.intel.com. [134.134.136.100]) by mx.google.com with ESMTPS id c17-v6si7855581pgp.299.2018.10.05.08.11.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 08:11:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 134.134.136.100 as permitted sender) client-ip=134.134.136.100; 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.100 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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2018 08:11:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,344,1534834800"; d="scan'208";a="79013075" Received: from ahduyck-mobl.amr.corp.intel.com (HELO localhost.localdomain) ([10.7.198.166]) by orsmga008.jf.intel.com with ESMTP; 05 Oct 2018 08:11:57 -0700 Subject: [mm PATCH 0/5] 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, 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: Fri, 05 Oct 2018 08:11:57 -0700 Message-ID: <20181005151006.17473.83040.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. --- Alexander Duyck (5): 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: 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 | 33 ++ mm/memblock.c | 63 ++++ mm/page_alloc.c | 555 +++++++++++++++++++++-------------- 5 files changed, 485 insertions(+), 254 deletions(-) --