From patchwork Mon Oct 15 20:26:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 10642439 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 0A2191057 for ; Mon, 15 Oct 2018 20:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEC6529FAB for ; Mon, 15 Oct 2018 20:26:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E25822A01C; Mon, 15 Oct 2018 20:26:54 +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 7426D29FAB for ; Mon, 15 Oct 2018 20:26:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AF256B0006; Mon, 15 Oct 2018 16:26:53 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 65EAE6B0007; Mon, 15 Oct 2018 16:26:53 -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 5001C6B000A; Mon, 15 Oct 2018 16:26:53 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 0D3BF6B0006 for ; Mon, 15 Oct 2018 16:26:53 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id h9-v6so15392858pgs.11 for ; Mon, 15 Oct 2018 13:26:53 -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=ZKHP4Ex7QikXtqSTGdz8pHUYfkIQb4YBhQv3c1CstXM=; b=YDeotcldzwR9M9BRAVKlx8FvQntdV5FSd9wn+M/vqSUVnEGiix5YkeIHVwKCKDzoC8 EBQk7bT5DSAM3V1txqmy53mQeHJKdkgQ3sVfAPnyyX2RjT8912RonvXScJw5IeU0Y+ox nBqrBPUQ5EpIE6fWdCNj3HoOZPmYm0r+y2vqkUffqomUAOxcLT4Jr4ReTLHj7xoi7Z4R kSLLyVO/V132YqQbEWZuzcgAkY5sQvGKe0wznKuEY85l0w08uuLoui1gNF2KJHnkzRiu OVCxgsogxCO/iXsJ0eupjJV04/3E+gGGZilVd34i/iDkWC3TZI0E527cnpSVQZ0l1bU+ PEUA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 192.55.52.120 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: ABuFfohBqBVflCbu4mJ8CF/esHG3BQ3LZL9WUPrDqJp2YWa6a9Bhj0XD bl6tXKG8Y5VyZ7cwADpy0Yt4FWhvTjxU8WYVayWdie+67+CSg1uXqjFJoF7r6XFSOjKfCNDPIt7 y6NY87dVpemQ5cfRlcIZKTL+WllmUWImspSwiN1slgUsoFCmDa0TRMl8OEDT7bunQAw== X-Received: by 2002:a17:902:b615:: with SMTP id b21-v6mr18261291pls.266.1539635212718; Mon, 15 Oct 2018 13:26:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV63/XkdpJ8J09mFRPK5zsVUmwxLO+6w1++JgDb3bK0RYD1X0klxX4bkpu8ekBwcP+OVTr/oZ X-Received: by 2002:a17:902:b615:: with SMTP id b21-v6mr18261254pls.266.1539635211850; Mon, 15 Oct 2018 13:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539635211; cv=none; d=google.com; s=arc-20160816; b=nk9FTN8Lv8QCVHADj3V+MeiOfGSlZR663olxAi77ksdsGAEz3HVRFABp/GrsTE3Mtm Z3KHMQB8+SNrVvQ4CJ/iWZ6vNeGJSfZaRXWRWtSa959vp5SdMqHhG4+SdLcTv5BB2WkP PPTM2eclPvJ0BOt2N5YDrRqrvEIHoK1AsAZRQSWy+pZXnShUU8NlNgsfRcG30THQ99Xv f2JrhMLatyiU+4XEVsFUmLoetNfflh2Rv8JTJOG5XK5k1htIkD84D0X34HMgDLgzVOHd WeE5sjgtaYNjSx9jcpSkK/0//BELjfHDQG5Wl1APtSgXU5xxSvJCKPC4ih0aQGQJEkr9 k40g== 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=ZKHP4Ex7QikXtqSTGdz8pHUYfkIQb4YBhQv3c1CstXM=; b=NRAc+w+COrNXemJUc04ahkkvivG5W1EwqX+cK5OxbWb1hJwp8FCF9uSKCoq89qWZ2r GWpIlIYgUFd6ulCHfvyyfPXFwfwsQpQVHPeF+Pb29C61fNI/ArHvdPDIiTnlpENpEvD6 mruxGjpR8ysxJsyGxBNzEV/ibY56sjJce0fvbZs57p/MvtkxWii7pGFnPPxFndOCKeia H3KJqYxfo76U2Wx3tghDxw/Zw5tXEF0UuFSKTYHVQ1sx/XyjLS82HBsr2EEPDZyaOHof tzX0Q4dI6fMyDe+Vvy+WeK5C+rZ34c2MWRz38XxLY8paW2JL0rWAVGBxP9UqyH+FZg7z UtQQ== 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 192.55.52.120 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 mga04.intel.com (mga04.intel.com. [192.55.52.120]) by mx.google.com with ESMTPS id bb10-v6si11218652plb.359.2018.10.15.13.26.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:26:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 192.55.52.120 as permitted sender) client-ip=192.55.52.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of alexander.h.duyck@linux.intel.com designates 192.55.52.120 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 orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 13:26:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,385,1534834800"; d="scan'208";a="92202432" Received: from ahduyck-mobl.amr.corp.intel.com (HELO localhost.localdomain) ([10.7.198.154]) by orsmga003.jf.intel.com with ESMTP; 15 Oct 2018 13:26:49 -0700 Subject: [mm PATCH v3 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: Mon, 15 Oct 2018 13:26:49 -0700 Message-ID: <20181015202456.2171.88406.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 slight improvement for the persistent memory initialization, the improvement is about 15% from what I can tell and that is mostly due to combining the setting of the reserved flag into a number of other page->flags values that could be constructed outside of the main initialization loop itself. 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 v2->v3: Removed patch that had removed __SetPageReserved call from init Tweaked __init_pageblock to use start_pfn to get section_nr instead of pfn Added patch that folded __SetPageReserved into set_page_links Rebased on latest linux-next --- 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: Move hot-plug specific memory init into separate functions and optimize mm: Use common iterator for deferred_init_pages and deferred_free_pages mm: Add reserved flag setting to set_page_links arch/sparc/include/asm/pgtable_64.h | 30 -- include/linux/memblock.h | 58 ++++ include/linux/mm.h | 43 +++ mm/memblock.c | 63 ++++ mm/page_alloc.c | 572 +++++++++++++++++++++-------------- 5 files changed, 510 insertions(+), 256 deletions(-) --