Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp915911imm; Fri, 28 Sep 2018 08:51:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dOQpL4K1SHgBQwrH8kP+SWvH03LUUaxm26+eJUsh4gwa5H3izVm5arvbAtLIuxlkdWe7/ X-Received: by 2002:a17:902:27a8:: with SMTP id d37-v6mr17025678plb.290.1538149886137; Fri, 28 Sep 2018 08:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538149886; cv=none; d=google.com; s=arc-20160816; b=PRfls90kYymXfShL8bqWOoikbG4lDEiSE457PGJamdVN/9z+1tjErAQz1gDSQvuVMg sK7hTNvG6W2IiYik3aZvaUN1KE/RmO9TcunqNqbaxL8Mbu7uW1XPmBqXuXon/GBJ52nY u5z/45Zb5sE1YrbSC+/5Q8IsBnNNJ6hi4/8O7qzHpeKs+t4Ljayy9r0Iny9zm1YR0c8d 0c5inwD2IwypYQYttDekZUC5WDlP+8mPRfqQT7+xf693jxb/ZOJJJR8kMHceQ0X5RIYV ky9Wf2NRnb4fJOzyho6kH9OneLH06SZDVK5JLPsgZR7WPKywn8ijBtcthq0nXm9wHHC8 jQMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xjBb3SQH/hsxIPobB+9r5d85WlcL1nVs52vIZOMa+bE=; b=PywqN8abfnD0qkf+I4N30HHsmlT7O6ReCMvHWhCCElabJVMknDFUOjorWO9mCC4JHT BdlU4vmRcriU4URiNN9rTSwmsmNkV7TYb9SP9XmLOKfP0im4/ctUGcZQLoDgHv7XmCu6 /XaJeW+bNxtmN2AI86xrBSK6et3CCTNlD9ZSVXrKUFCRVrQdhA8jC+V5EHftUbTfoZcx l/0iv7nqkLFu8wFi/h2iQ79AuTu9YRsPFqXOQLJzxtm/YV3QTHLo28sGvsAHKT08G7y9 yQVbSffTBbwZEKXe5s6kav9G4iJmrPpAg9s+LKNRyx79l8T85WMIIW9ZnMBKSBbgue6R gkag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=UjPfCt97; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62-v6si4775575pgc.79.2018.09.28.08.51.10; Fri, 28 Sep 2018 08:51:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=UjPfCt97; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729590AbeI1WPU (ORCPT + 99 others); Fri, 28 Sep 2018 18:15:20 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:42342 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728765AbeI1WPU (ORCPT ); Fri, 28 Sep 2018 18:15:20 -0400 Received: by mail-ot1-f66.google.com with SMTP id h26-v6so6455667otl.9 for ; Fri, 28 Sep 2018 08:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xjBb3SQH/hsxIPobB+9r5d85WlcL1nVs52vIZOMa+bE=; b=UjPfCt971qK4Ooiyf51ime1IugxUXn+QnJaQZGysf9PqdWuh0xaFLa2oTkns5rTB8p Sb1K9Fy9Kx9af92II7788S5e6mKXjKxfuFlLIaATzhfR/mwadEj29KUgCfw9edRVBcjK VySmGzIsFKdxX+RmakF0O02sa5fXdb+TT0gHPLZDKpfQgB6DqnjJ3V/GI41F08VMTGLz g3mYFpjR09j2ObH4/EZyOH5nXEf+POEFjmQIChHAebsHTWulWio4WP3MfRxsIrBXmi0N dgrlCrOnKUWr9AE8yjTY7YKh0Os4ao3pYAy5+E1VmLhp5CfwGj90hTKEkYZzzg0qFZPA tJUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xjBb3SQH/hsxIPobB+9r5d85WlcL1nVs52vIZOMa+bE=; b=fQ4EOFr8BspgogBFicKHKP58lJ/pyUHWcU9RjV14JSvfUtUFKVDtrI1qQiM3bhyXOL DnXTZcfSZ3WNfW4Ek9HPtZTkdj0kVlApHYDGYHtxNoiNUMP+mVGYJHoAjWB0XB8umr2B CX/fsMvWkSME5oiZMozR6tb50QlaUNPi+oeQaJw51kvmIjbTcrJd6NLwsatRhTyscy7Q o/xSBFbUpoSXMZjcRjgSzgpXH+c9I4bczweeN1iIWMmCUv9FEl8YgGZZXImbOXp8WiN9 2p4A0ahnAQwAphe4G4pOde1qR6piAiyi6jL7ayvbOOZDYbMxMI7EFRsyWyqgCM/JVBAf rP6Q== X-Gm-Message-State: ABuFfogGt6MLwaTkh6tLBMIDvagUVX8jkUgcRFm78NQAzC7hZm85KJLr S75nODVokbAU8V4bDWrtkobksFa73XQP+SRBADbnwA== X-Received: by 2002:a9d:530c:: with SMTP id g12-v6mr10202171oth.353.1538149858104; Fri, 28 Sep 2018 08:50:58 -0700 (PDT) MIME-Version: 1.0 References: <20180925200551.3576.18755.stgit@localhost.localdomain> <20180925202053.3576.66039.stgit@localhost.localdomain> <20180926075540.GD6278@dhcp22.suse.cz> <6f87a5d7-05e2-00f4-8568-bb3521869cea@linux.intel.com> <20180927110926.GE6278@dhcp22.suse.cz> <20180927122537.GA20378@techadventures.net> <20180927131329.GI6278@dhcp22.suse.cz> <20180928081224.GA25561@techadventures.net> <20180928084433.GB25561@techadventures.net> In-Reply-To: <20180928084433.GB25561@techadventures.net> From: Dan Williams Date: Fri, 28 Sep 2018 08:50:46 -0700 Message-ID: Subject: Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap To: osalvador@techadventures.net Cc: Michal Hocko , alexander.h.duyck@linux.intel.com, Linux MM , Andrew Morton , Linux Kernel Mailing List , linux-nvdimm , Pasha Tatashin , Dave Jiang , Dave Hansen , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , rppt@linux.vnet.ibm.com, Logan Gunthorpe , Ingo Molnar , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 28, 2018 at 1:45 AM Oscar Salvador wrote: > > On Fri, Sep 28, 2018 at 10:12:24AM +0200, Oscar Salvador wrote: > > Although I am not sure about leaving memmap_init_zone unprotected. > > For the normal memory, that is not a problem since the memblock's lock > > protects us from touching the same pages at the same time in online/offline_pages, > > but for HMM/devm the story is different. > > > > I am totally unaware of HMM/devm, so I am not sure if its protected somehow. > > e.g: what happens if devm_memremap_pages and devm_memremap_pages_release are running > > at the same time for the same memory-range (with the assumption that the hotplug-lock > > does not protect move_pfn_range_to_zone anymore). > > I guess that this could not happen since the device is not linked to devm_memremap_pages_release > until the end with: > > devm_add_action(dev, devm_memremap_pages_release, pgmap) It's a bug if devm_memremap_pages and devm_memremap_pages_release are running simultaneously for the same range. This is enforced by the requirement that the caller has done a successful request_region() on the range before the call to map pages.