From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (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 EB0BE21A00AE6 for ; Tue, 11 Sep 2018 15:35:05 -0700 (PDT) Received: by mail-oi0-x243.google.com with SMTP id l82-v6so50423706oih.11 for ; Tue, 11 Sep 2018 15:35:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180910234354.4068.65260.stgit@localhost.localdomain> References: <20180910232615.4068.29155.stgit@localhost.localdomain> <20180910234354.4068.65260.stgit@localhost.localdomain> From: Dan Williams Date: Tue, 11 Sep 2018 15:35:04 -0700 Message-ID: Subject: Re: [PATCH 3/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Alexander Duyck Cc: pavel.tatashin@microsoft.com, Michal Hocko , linux-nvdimm , Dave Hansen , Linux Kernel Mailing List , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton , Ingo Molnar , "Kirill A. Shutemov" List-ID: On Mon, Sep 10, 2018 at 4:43 PM, Alexander Duyck wrote: > > From: Alexander Duyck > > The ZONE_DEVICE pages were being initialized in two locations. One was with > the memory_hotplug lock held and another was outside of that lock. The > problem with this is that it was nearly doubling the memory initialization > time. Instead of doing this twice, once while holding a global lock and > once without, I am opting to defer the initialization to the one outside of > the lock. This allows us to avoid serializing the overhead for memory init > and we can instead focus on per-node init times. > > One issue I encountered is that devm_memremap_pages and > hmm_devmmem_pages_create were initializing only the pgmap field the same > way. One wasn't initializing hmm_data, and the other was initializing it to > a poison value. Since this is something that is exposed to the driver in > the case of hmm I am opting for a third option and just initializing > hmm_data to 0 since this is going to be exposed to unknown third party > drivers. > > Signed-off-by: Alexander Duyck > --- > include/linux/mm.h | 2 + > kernel/memremap.c | 24 +++++--------- > mm/hmm.c | 12 ++++--- > mm/page_alloc.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++- Hmm, why mm/page_alloc.c and not kernel/memremap.c for this new helper? I think that would address the kbuild reports and keeps all the devm_memremap_pages / ZONE_DEVICE special casing centralized. I also think it makes sense to move memremap.c to mm/ rather than kernel/ especially since commit 5981690ddb8f "memremap: split devm_memremap_pages() and memremap() infrastructure". Arguably, that commit should have went ahead with the directory move. _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm