From patchwork Mon Sep 10 23:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 10594903 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 94BA814E0 for ; Mon, 10 Sep 2018 23:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8396A291BB for ; Mon, 10 Sep 2018 23:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77165291F4; Mon, 10 Sep 2018 23:43:40 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable 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 2004B291BB for ; Mon, 10 Sep 2018 23:43:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06A068E0004; Mon, 10 Sep 2018 19:43:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F32148E0001; Mon, 10 Sep 2018 19:43:38 -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 DFB158E0004; Mon, 10 Sep 2018 19:43:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id 99C688E0001 for ; Mon, 10 Sep 2018 19:43:38 -0400 (EDT) Received: by mail-pl1-f199.google.com with SMTP id bh1-v6so10644215plb.15 for ; Mon, 10 Sep 2018 16:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:cc:date :message-id:user-agent:mime-version:content-transfer-encoding; bh=Yw9vxWJ6YGklpxQJwQlNRm6osFUbXs3EZVyomclg/uU=; b=PpcSvolLFqxtgKG8A/KPtKI2ZoVxGaFFA3bCAtH5pBR3erKzSj2DzO6uSEAVc9keic oM/uFdhMAp1BMC+WH+lVDDsTnBo8tJrMx03vgeQHs1XUr7q7mzXBmfWuPbUxb4hRweFc 8ZZqE/9Gopp4q2NmYhd6AZGj2ek9ZrBqLaQk4QmfTnYRNCDG9w45Dq3UP65CI370w23h yMpXDw/ILe0Wfu2pPZT+JM3rQBkgq8Ih+2Xer9S2fSCGdXzjynpumem35wSUEn3v2unz vJOSbO/v63ICvnWUkaxZ+8PJVkkTaCuEu7X7+KocsHIM+FNUHQdQHCV3/Y0PFqsdrMX0 tSxg== X-Gm-Message-State: APzg51Cu1yUwh9KVvfAEZHOcCfRk6ipH56Ja72/A6pxZUyQJH2eG5Jb2 YkNXUv1OPtaAI9uFshjZ1BOe7vI1S5KYIyCsKBNph6SAvSgng3gtEOQoQfPdBfZiNs4e6ZS0nbt RdQQQlPQVZ7iPzqm9VIRNhWM1DMOmFBKKZRpmJPO4qeYgV0vn6nB6vfjKXw4twSOHZ6PAmaFXWf OFksYFeKxzvyiDoyVd7cAyankBn12dsg74iD6OQ0OP1VyIm+ADHFcsxM0z4QqObhA73wOuRTpUQ 6/NCVJKs85tE5pEtco3VUEZXzH2XjYxSdJ4hW3Fvcs203r+dtL9G7IJZZ1f+P+C383bh89kymCT 0TNcjftThq0hfIOgukDWkFK0qIXUb1b0xa6Q6exMLMmJR03JJEzR8+s4TNXPCk+f0K3X8cgK2us g X-Received: by 2002:a63:f4b:: with SMTP id 11-v6mr25611070pgp.100.1536623018279; Mon, 10 Sep 2018 16:43:38 -0700 (PDT) X-Received: by 2002:a63:f4b:: with SMTP id 11-v6mr25611035pgp.100.1536623017499; Mon, 10 Sep 2018 16:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536623017; cv=none; d=google.com; s=arc-20160816; b=kmTCCijjb1/G22IkgkulIPDB4/l1rAf9nOxyleQvqo2XarI3/sLvB2crMW6/A+xt1u OY5KBsG583FxagXD0DZHd98aYrigJMmuCBWV8BccwcjA2PxqicHghgp787r0BKwaDslH 0E4tebLnPFz80lY8KumalYm7vpnRnbEBM5l9o6HbJj34OLq1HSljNsl7uADl+crvo6z8 v4E/PUbUnn+Ufp27/LPc4YjkeLVUMOskKUajHk8+yL+zb2ushU316MdVKiRuUmsr2XQX 6V3hgZSELYGURoAhvDbUs/yf8U/GovBXyFSMQDRhyKsEZrXScwJb3r2J7mipNsP7+QEH ENYQ== 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:dkim-signature; bh=Yw9vxWJ6YGklpxQJwQlNRm6osFUbXs3EZVyomclg/uU=; b=nM5QuXbh7i8qY4YQX1E2WagOXqAwLkxNClCw0NRFdoNSPn0fuLaxWGJlFEh+umv4EV dfbV7H5r7wCTEIIA0+nJwKc48GSKdX+YgzdTz1dDTMONOHnIYreTYk03MVG14rHc6g69 C8FAKrv5ii7kBAINPI8wll1grFdipWBa8fPQkgwmIWQ2fj+ALU71mGZpd/XWGyNjCOEl K/KTGMFnGXxMekJuR0A7SyDQQxo8dK3YePqF8qaAeyAPi9cLxHddHiKpx9Z/qfMAJqrc lJgOjMFJGjT30E4ss7DF5l5MaRhq5u53f56EKUmDOHGqwuwbYHoAVlTY9xLxcYd/mxW3 1bgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bcjDolYs; spf=pass (google.com: domain of alexander.duyck@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=alexander.duyck@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i5-v6sor2564805pgl.368.2018.09.10.16.43.37 for (Google Transport Security); Mon, 10 Sep 2018 16:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of alexander.duyck@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bcjDolYs; spf=pass (google.com: domain of alexander.duyck@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=alexander.duyck@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=Yw9vxWJ6YGklpxQJwQlNRm6osFUbXs3EZVyomclg/uU=; b=bcjDolYst6bXqjaW2RF8VHS4mSuZOYlLSSbZ6BmoiNT0YAd2yOI5U3yIwRYQA+ds82 uYAX3p/rJJTc3cM1WNxmUAIGs378sHp/YuIBRuQKfhv6+jSga3YCYPcHBX8jX1GWkJYX DkHdoSOk1DIV4T8Xx9WGiGb8LqEmVXpld9UbgbhfgAgOd+j5u5eo9+j0I1PHPoZP190C 1+tCDBUsj73eqWH6dUM18zs5q+BaIDG5jmZd28uH8dJi30iCMr28MMUuxTsIlukpdfId VNfGa11mwN3fGGZ/W6LcU4slqG+ywFzP2FgE98tU81ta3isMFZi86114mNnIUuIDggK1 vArQ== X-Google-Smtp-Source: ANB0VdaYs/qwPckOqIjVc/MF9qQPl75UPWohNaI8P/32wDdPVKiG2ZTn76uNfSuuQoMVnCuOBlIxiw== X-Received: by 2002:a63:d90b:: with SMTP id r11-v6mr25397961pgg.315.1536623016848; Mon, 10 Sep 2018 16:43:36 -0700 (PDT) Received: from localhost.localdomain (static-50-53-21-37.bvtn.or.frontiernet.net. [50.53.21.37]) by smtp.gmail.com with ESMTPSA id 16-v6sm27924027pfo.164.2018.09.10.16.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 16:43:36 -0700 (PDT) Subject: [PATCH 0/4] Address issues slowing persistent memory initialization From: Alexander Duyck To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Cc: pavel.tatashin@microsoft.com, mhocko@suse.com, dave.jiang@intel.com, mingo@kernel.org, dave.hansen@intel.com, jglisse@redhat.com, akpm@linux-foundation.org, logang@deltatee.com, dan.j.williams@intel.com, kirill.shutemov@linux.intel.com Date: Mon, 10 Sep 2018 16:43:35 -0700 Message-ID: <20180910232615.4068.29155.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 patch set is meant to be a v3 to my earlier patch set "Address issues slowing memory init"[1]. However I have added 2 additional patches to address issues seen in which NVDIMM memory was slow to initialize especially on systems with multiple NUMA nodes. Since v2 of the patch set I have replaced the config option to work around the page init poisoning with a kernel parameter. I also updated one comment based on input from Michal. The third patch in this set is new and is meant to address the need to defer some page initialization to outside of the hot-plug lock. It is loosely based on the original patch set by Dan Williams to perform asynchronous page init for ZONE_DEVICE pages[2]. However, it is based more around the deferred page init model where memory init is deferred to a fixed point, which in this case is to just outside of the hot-plug lock. The fourth patch allows nvdimm init to be more node specific where possible. I basically just copy/pasted the approach used in pci_call_probe to allow for us to get the initialization code on the node as close to the memory as possible. Doing so allows us to save considerably on init time. [1]: https://lkml.org/lkml/2018/9/5/924 [2]: https://lkml.org/lkml/2018/7/16/828 --- Alexander Duyck (4): mm: Provide kernel parameter to allow disabling page init poisoning mm: Create non-atomic version of SetPageReserved for init use mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap nvdimm: Trigger the device probe on a cpu local to the device Documentation/admin-guide/kernel-parameters.txt | 8 ++ drivers/nvdimm/bus.c | 45 ++++++++++ include/linux/mm.h | 2 include/linux/page-flags.h | 9 ++ kernel/memremap.c | 24 ++--- mm/debug.c | 16 +++ mm/hmm.c | 12 ++- mm/memblock.c | 5 - mm/page_alloc.c | 106 ++++++++++++++++++++++- mm/sparse.c | 4 - 10 files changed, 200 insertions(+), 31 deletions(-) --