Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp169020imm; Tue, 9 Oct 2018 15:51:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV615IjeslkAqJTGqh9/u1ffe5sIVXgP9qClDjllaqGOEomDFh0K/GIzvxSRGcinpZPFPYlEl X-Received: by 2002:a62:b87:: with SMTP id 7-v6mr32035802pfl.67.1539125504801; Tue, 09 Oct 2018 15:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539125504; cv=none; d=google.com; s=arc-20160816; b=DoLfbOBrRrAkcCmfYKvIntbaVcF1soonDdJaX4UDjW2T2lNxGgSEYUuPgkz73RRQV/ NADtu4LpTMIUiGTW5vYZnUqzUU+pa5D9Y5Z+MTe7S+/XQGcQRFPt254/TLzsEJmJEZcU O1gWTGlEF8MX1FKpb9kVMaMmAbhfZ+fzLs0YgXYy4yQI4gXVwt0df/pDBvG44aYdhFUe 7on6EZHkBru1IbNVC1WvEe4C+vneWOC/mn6XPD542YfRlDSaoqN/hRWTsqyVNQWifWkr aspZTgEit/hOw/JDnTQLZEQZXFQPVTTpdEQJvr1Qdu+M5fpPGcTtegiZTzQKBf+F9vEi FMcw== 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=C0f0hMX+gSDGnKkxqDYZS5nIHXdII+6YNR+G/UkZ8PA=; b=M4yOC6K+UjRxIn2mwA8e3EcDS0lUriwIGTmO3awdTWrVGBG1iFR7K6UnXmA2kjvg0j Drh+1gaD9o6DIT1xBmbYyvWsDgNAlzOWlrmyyp5RBQV5T/4UjJkLWG53VsUqZxlkBqrM VEHOHzr9iIkwF8bT9aOa4uvVqooYJTV69qsHpTQ0dbb6iof9o3iDE4mG4djp70axghMK fPW6HlGF8EGUGZvSPuj5EvmLFiPDlawdKsXTJ/+MFFiPEK87ue+Cqj7wg+MIUyC57SP3 lQVl/jbVWriR9N5nAaukM7IjyXbf0OfVvVKm4dOYIn0FhPp7qnjUY8hxxy/ywvalpl0w Vm7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=xLNh3BXu; 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 j184-v6si24359357pfg.210.2018.10.09.15.51.30; Tue, 09 Oct 2018 15:51:44 -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=xLNh3BXu; 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 S1727958AbeJJEif (ORCPT + 99 others); Wed, 10 Oct 2018 00:38:35 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:34154 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbeJJEif (ORCPT ); Wed, 10 Oct 2018 00:38:35 -0400 Received: by mail-oi1-f193.google.com with SMTP id v69-v6so2437916oif.1 for ; Tue, 09 Oct 2018 14:19:43 -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=C0f0hMX+gSDGnKkxqDYZS5nIHXdII+6YNR+G/UkZ8PA=; b=xLNh3BXuq2lr5G5nAdaZT13aTzzGdDHThU/0tCt5MwWwzmdBJx3hxjLz1EjiaOC52v iLDmxDuoOsxz7bEkt/EiNjgTZ+zeWv9a0JpxFNYUAeaidJK9r7YE4IFwjomgiCYaildp KwEor73uKjdIxn5bg5KYiVAA03AY82TLCvJyLU4K0A1cl9GiMwX88buvaNoHEdAKNcAy frbyNnUpPyu+LIh3UCxVhkZZCF6N0TSbzhO+9zzJfKtiNJ344aju9UWJqEPsMMRJes6D Wk0l4Dt8KDqD71GelOdOULrNiSW2EMnteWxKXoMda52SrYPuy0j8yKchTwzK43BQd7zz Zjhw== 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=C0f0hMX+gSDGnKkxqDYZS5nIHXdII+6YNR+G/UkZ8PA=; b=bvNvygCLuLusWf8qCykZUqiyAZP82WHpC1hXQhyZd+sRfbpMzlwJVC24u75T4PutI5 UjkEvXknTcL11FQCFb6TGHun+07yn0TsYjS4Q31lGsMLwG34SR/64McQ8X+SExv2A3Iy 1/QTz+PsbpatKM4o4DvWWnmeeOrAImXbTxu6Wv0Xjl5GE7JJxDJ/dXT+WS43m1dra99Q ppP/OdAqJ/CssQxDPXLSfNgGJ4sz6C/OOI/5uutXPkf51ARDdGSfMxGD4QlKZjrzMSO+ 38zonFAySFu/mySuNnPrh3CXNMZDErktNAPwfc6S/XEYzOjCEqye/iwuvomBG8/ug6+W 22oA== X-Gm-Message-State: ABuFfogdxnGcXbG6Ejzma8WKzb9DZ51/xQV1kc9M3fIN29Pxvevau5/W jmWUoU9IiDad6WjDHwezLYBF9NJBwAhah2bL8C1YPw== X-Received: by 2002:a54:4516:: with SMTP id l22-v6mr119577oil.0.1539119983079; Tue, 09 Oct 2018 14:19:43 -0700 (PDT) MIME-Version: 1.0 References: <20180925200551.3576.18755.stgit@localhost.localdomain> <20180925202053.3576.66039.stgit@localhost.localdomain> <20181009170051.GA40606@tiger-server> <25092df0-b7b4-d456-8409-9c004cb6e422@linux.intel.com> In-Reply-To: <25092df0-b7b4-d456-8409-9c004cb6e422@linux.intel.com> From: Dan Williams Date: Tue, 9 Oct 2018 14:19:32 -0700 Message-ID: Subject: Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap To: alexander.h.duyck@linux.intel.com Cc: Linux MM , Andrew Morton , Linux Kernel Mailing List , linux-nvdimm , Pasha Tatashin , Michal Hocko , Dave Hansen , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , rppt@linux.vnet.ibm.com, 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 Tue, Oct 9, 2018 at 1:34 PM Alexander Duyck wrote: > > On 10/9/2018 11:04 AM, Dan Williams wrote: > > On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang wrote: [..] > > That comment is incorrect, device-pages are never onlined. So I think > > we can just skip that call to __SetPageReserved() unless the memory > > range is MEMORY_DEVICE_{PRIVATE,PUBLIC}. > > > > When pages are "onlined" via __free_pages_boot_core they clear the > reserved bit, that is the reason for the comment. The reserved bit is > meant to indicate that the page cannot be swapped out or moved based on > the description of the bit. ...but ZONE_DEVICE pages are never onlined so I would expect memmap_init_zone_device() to know that detail. > I would think with that being the case we still probably need the call > to __SetPageReserved to set the bit with the expectation that it will > not be cleared for device-pages since the pages are not onlined. > Removing the call to __SetPageReserved would probably introduce a number > of regressions as there are multiple spots that use the reserved bit to > determine if a page can be swapped out to disk, mapped as system memory, > or migrated. Right, this is what Yi is working on... the PageReserved flag is problematic for KVM. Auditing those locations it seems as long as we teach hibernation to avoid ZONE_DEVICE ranges we can safely not set the reserved flag for DAX pages. What I'm trying to avoid is a local KVM hack to check for DAX pages when the Reserved flag is not otherwise needed.