Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp86284imm; Thu, 11 Oct 2018 15:59:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV62PhbsYfu79tmI7VRNe6Yx4Mr3AV2xO6q1o7G8R3ie8DGsgADKwlasuQmiolK5Pfa26jVIU X-Received: by 2002:a62:564e:: with SMTP id k75-v6mr3471923pfb.33.1539298784663; Thu, 11 Oct 2018 15:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539298784; cv=none; d=google.com; s=arc-20160816; b=mvOU2Ti4EzXMTRm8aqL962smyO77Njpd+H0Gxo/Eu3b/NWEH5UGIGHw8tPrkpMWkyr oxwiq1ubk/gnBWZTqHUly0nEUThAZ2I2o/7Gfg/JiaRL7BekS56QtdLowa8yPCAdgZ7k js8ZR1WqoI0hl2P6q9GR4jZi/mBVFSmEdRSeRmFLt9oXJpRUC8XCHYelIO27LhFfm2Z8 dQkmffDypwFtE3AFCLn3tX2zMcxIV9D1+vp2h9686RgiKk2/AWz+22Hr8EjLhVNLNLFf ILBrywlLV5a34Om4AnhbCVy3DxfP6RQ/ozoG4T1GrK55f54/lPUvRVe1EW6oGgq9E0bl rN7A== 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=QJtgrdMIt5B2S4XIKnBe78Xf+qAbX4YZNj+zjUvyTzY=; b=ynbOO3oTnSsm1tyYIHdXVq2682+OA+taMLpIN2QytlnsyGL0Z9FNZuROAM9j7kDPqS PIBYtCVoZZqhAzk1it1JMwaBpBdrgUBzG63GzTALlyJM2A4apCOVTWBN6HC0Uc1fepbj 6KnJgKWpeAw/7cmRI5eRLXrDSx7aRfcTTJ+OcuaG6WBb4GRORqTp3qV3YOC8GPkvV13T lMWrM0zwKEbS7RVS/nS1rM4dtWRNkueI/OBnqHnOnk311yWxkXcEu+Owasp6ikDXwiGr 1AyJwxM/a4KGce5nyISanJwV8eC8tj4wiXr6Vp8o1Vm4w9aGwvGjLYDu0Uk5tBKJpaMB i7fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=V1yDxPZi; 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 y193-v6si26981069pgd.558.2018.10.11.15.59.30; Thu, 11 Oct 2018 15:59: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=V1yDxPZi; 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 S1726862AbeJLG2J (ORCPT + 99 others); Fri, 12 Oct 2018 02:28:09 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:40505 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbeJLG2J (ORCPT ); Fri, 12 Oct 2018 02:28:09 -0400 Received: by mail-oi1-f193.google.com with SMTP id j68-v6so8443096oib.7 for ; Thu, 11 Oct 2018 15:58: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=QJtgrdMIt5B2S4XIKnBe78Xf+qAbX4YZNj+zjUvyTzY=; b=V1yDxPZifZoR4YpF8N76DPyB5pYl931k7yBEW2N5VJHaNakxNoarE5vz3ZTGO5Y9F7 mesy1HC2cwnk8a8toptvxnWX/nwrEpATMUV/8w4WeMIlg4tblnh2iGCty5ZENYbeMV0f iZwIohj6rS6Cv7+Y/PYQVVjybvTQDfISJsV3zIDy10s6KEk2U81u4t5AO8VMRjHsqmqW HlYsboLhQWqgvcwuAbf0OS88NlHbnX0pKp0oLp+ylt+i+loL4KVpqI9BhaSDPC0a4C8w vw9Y+39jNml3QAXM+5ocASEDKpBFopjV9cqUcyA+dUMVbOXFcKRV6DE+4uFBizH/vglM pUrg== 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=QJtgrdMIt5B2S4XIKnBe78Xf+qAbX4YZNj+zjUvyTzY=; b=HHbcyU2rJpOJlGVyzBahC4RHpxRwg2qzWjaX4vxAjCBsw9hMEG0o26fwelvMtxHxWm IbOe9g8nvQi0JCx5qqlTcYrqwVOfhYioe5x+p6eNIxTmxfhsZeMMEGnqoiT+ksphHIk8 RnZKG9riWSu1BMu8cCHSUFxv5bBukTwQtaLQyNL+SVC7/SciKL0Eu8gEY68vNvTmINXW huGhJTc8FLJ6ay8zI3Qww7rSLZtc3QFapek5pyIULQ8mfg1qqix1+8XTW7wZ2xuJkRzP qRaG5Se2seHM416OQlfsY0HeeByltrzw2oYS0C+wjge37yEaEJa1DHxO4BmRSsHJNSrg wLUQ== X-Gm-Message-State: ABuFfohyhaHXR6Whjk7QI+GZDgylIViAWZWB9n1WmRE31u46daeWyNzj 2wCdoFDqXktf5nZeak8TyOAmMiykQto6+kepCu+xZQ== X-Received: by 2002:aca:f512:: with SMTP id t18-v6mr2059647oih.244.1539298722948; Thu, 11 Oct 2018 15:58:42 -0700 (PDT) MIME-Version: 1.0 References: <20181011221237.1925.85591.stgit@localhost.localdomain> <20181011221351.1925.67694.stgit@localhost.localdomain> In-Reply-To: <20181011221351.1925.67694.stgit@localhost.localdomain> From: Dan Williams Date: Thu, 11 Oct 2018 15:58:31 -0700 Message-ID: Subject: Re: [mm PATCH v2 4/6] mm: Do not set reserved flag for hotplug memory To: alexander.h.duyck@linux.intel.com Cc: Linux MM , Andrew Morton , Pasha Tatashin , Michal Hocko , Dave Jiang , Linux Kernel Mailing List , Matthew Wilcox , David Miller , Zhang Yi , khalid.aziz@oracle.com, rppt@linux.vnet.ibm.com, Vlastimil Babka , sparclinux@vger.kernel.org, Laurent Dufour , Mel Gorman , 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 Thu, Oct 11, 2018 at 3:18 PM Alexander Duyck wrote: > > The general suspicion at this point is that the setting of the reserved bit > is not really needed for hotplug memory. In addition the setting of this > bit results in issues for DAX in that it is not possible to assign the > region to KVM if the reserved bit is set in each page. > > For now we can try just not setting the bit since we suspect it isn't > adding value in setting it. If at a later time we find that it is needed we > can come back through and re-add it for the hotplug paths. > > Suggested-by: Michael Hocko > Reported-by: Dan Williams > Signed-off-by: Alexander Duyck > --- > mm/page_alloc.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 3603d5444865..e435223e2ddb 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5571,8 +5571,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, > > page = pfn_to_page(pfn); > __init_single_page(page, pfn, zone, nid); > - if (context == MEMMAP_HOTPLUG) > - __SetPageReserved(page); At a minimum I think we need to do this before removing PageReserved, to make sure zone_device pages are not tracked in the hibernation image. diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 3d37c279c090..c0613137d726 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1285,6 +1285,9 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn) if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page)) return NULL; + if (is_zone_device_page(page)) + return NULL; + if (PageReserved(page) && (!kernel_page_present(page) || pfn_is_nosave(pfn))) return NULL;