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: 10594901 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 F0B116CB for ; Mon, 10 Sep 2018 23:43:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFCE8291BB for ; Mon, 10 Sep 2018 23:43:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D372A291F4; Mon, 10 Sep 2018 23:43:38 +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.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID 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 6E875291BB for ; Mon, 10 Sep 2018 23:43:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3A62521127CC0; Mon, 10 Sep 2018 16:43:38 -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 A968321B02822 for ; Mon, 10 Sep 2018 16:43:37 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 2-v6so11259657pgo.4 for ; Mon, 10 Sep 2018 16:43:37 -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=Yw9vxWJ6YGklpxQJwQlNRm6osFUbXs3EZVyomclg/uU=; b=bcjDolYst6bXqjaW2RF8VHS4mSuZOYlLSSbZ6BmoiNT0YAd2yOI5U3yIwRYQA+ds82 uYAX3p/rJJTc3cM1WNxmUAIGs378sHp/YuIBRuQKfhv6+jSga3YCYPcHBX8jX1GWkJYX DkHdoSOk1DIV4T8Xx9WGiGb8LqEmVXpld9UbgbhfgAgOd+j5u5eo9+j0I1PHPoZP190C 1+tCDBUsj73eqWH6dUM18zs5q+BaIDG5jmZd28uH8dJi30iCMr28MMUuxTsIlukpdfId VNfGa11mwN3fGGZ/W6LcU4slqG+ywFzP2FgE98tU81ta3isMFZi86114mNnIUuIDggK1 vArQ== 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=Yw9vxWJ6YGklpxQJwQlNRm6osFUbXs3EZVyomclg/uU=; b=JMf9/zld+hURBdDWcRljSQWFzyL+MaBWBIzs8yurmxaNuQBCYXYG6sxigG6nrQS7Rl wLPvEkx8IDO5m4o2QD70+oV8ACOukEKEFRKhA9funIwSM5IL09zqPHk7hoyCiuf7G4pp x2WRooCmETl3qpvLZDhyU+0wJRAjGtL0riQUsCekMTinEVN6QiHxBVYVo76u9JSqHb6q xlSC3ZCBsWQIUoUdRUet6BZZIRXnBJ2AxXWJVRwV3vYtH9Yfkj0vEMODIf8yI1sKk4ia MpKHkPBYmicA0iEpJ2vDwYLExHNteyyNTtkwEnva5CSJ/gDHIfHPFt8RFqsoSgfbjwZt 2Aig== X-Gm-Message-State: APzg51Dcz/AROuAii5t5VoV6VnebyYUo2SfR32mBPEZamc8lXS8ZK6IU 9W5A7K24ukVnB+BlHj6K/vU= 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 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-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, dave.hansen@intel.com, jglisse@redhat.com, akpm@linux-foundation.org, mingo@kernel.org, kirill.shutemov@linux.intel.com Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" 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(-) --