From patchwork Mon Nov 19 10:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10688395 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 710EE13AD for ; Mon, 19 Nov 2018 10:17:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BB4F29B89 for ; Mon, 19 Nov 2018 10:17:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FAB829C25; Mon, 19 Nov 2018 10:17:26 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAC6F29B89 for ; Mon, 19 Nov 2018 10:17:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0C746B1A41; Mon, 19 Nov 2018 05:17:24 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B96D16B1A42; Mon, 19 Nov 2018 05:17:24 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5CB36B1A43; Mon, 19 Nov 2018 05:17:24 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 76DF86B1A41 for ; Mon, 19 Nov 2018 05:17:24 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id 80so68595447qkd.0 for ; Mon, 19 Nov 2018 02:17:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=uHWO9jQ0jVzDi3yMJpemvnTc99QXepZ+Jaaf6/1UIes=; b=W6po9/hACS/s/XMYcRVcTGZSdorsBal/hhFOfCmhttcBBzdReAw+PWKOGgN5Nsb7/p bcF9rGpcDPfhUH15Gz22Ca31I8dw2KINQT513d7TzuZAzTzTPiqA5dHbbGiDhbV1eKMB csVGF8FMKjUe5CxzDbHjxD3urMqiLv7OWVugwkhXG34QEA3yoMaUDU2rAWx+nFp34hFd yAiYPlia10tts9PFDQGo9FFgzx6YA00vc1CquXA2ectU/boOPvIcn/hkPTwJGPj9jAVE +QbrsSQMAAhwaxgAGCQi58DVsfXVIXLTKnx9KyRxQLkyz16zkjOcw6/02ERCfmn5IlvZ L5fQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AGRZ1gJCu2IlyL3P//ueKUpSXwaOucgIoF0BgpBUYfq+OEhhhp+PHn23 f6Qfz++JjoTFqj0oIopKD8A/Qmd9qoNcrPY/ixnIAqCQywySPWTJkxbR8mBvamca+BInJX5HdZc 0dcAXJHJBnoZd32cbu4MTWKeyr2F8G5wzXE2vxFmHLKv+ADwvea/UiWdERjM1KfuleQ== X-Received: by 2002:ac8:32b2:: with SMTP id z47mr20043825qta.209.1542622644245; Mon, 19 Nov 2018 02:17:24 -0800 (PST) X-Google-Smtp-Source: AJdET5dLFvkKNVk3/+CQvDyxD9hnB+ZEOyBD8Fhh3ArUc+oFMg7OrtqOWPtH9L4w6arzP0/1jP/q X-Received: by 2002:ac8:32b2:: with SMTP id z47mr20043793qta.209.1542622643480; Mon, 19 Nov 2018 02:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542622643; cv=none; d=google.com; s=arc-20160816; b=ydbG04HpObbfWBm+Dq7p/jnpUKLB9QzBUhP89LCmhza6m9DNaXayHgZ12LLZYKGwD6 Z9aaQrmKkyoTuCxJ/xfCeELgjsm8r/EEhRxpf4gSxPxQeF2XZRZGvZ0c0jLtbBtqk8Mm nOiIxO/CDrZLtZzDKBNW9FtCN/n9FEk0PG0RkFYIbKSu1/xc7GGWJ57/FuL6tKGtjHUm lVGXzOVs+GA0zUv4Yx3T9CGjjQKBeZnBLWO1i6LTlWMVT9NrLcdsmpsXp+3I3filJXgZ mxRX/xeqZcNi+BWpaj5yG86L/PCYMGttJ7UF60D7GUbg3iJUR0WVAKBVSVUTZvcuuTxn BGdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=uHWO9jQ0jVzDi3yMJpemvnTc99QXepZ+Jaaf6/1UIes=; b=Yp/XzwZTlPkHd+BBAo0/7KdJdT4i+HyUgVhtbGTIwvLHxdmU5tj67Ts76mDxAjj+30 bnXfns6IFg+x+ZA24lz18SNzO/NAiau8dd7pxGXySokIDmx0c8hihKylUjEoo+iJGV3r qITrTf2RADMaJ1nIsMRwCN34MfUJEB1p9m1liHPTSEm7jN65hwdDCKnNqmZ2WK9QanYt VBR+6CFDJ/GSI9we+JGYHe1PyzIf+pvKaWhHThbzOEZvrd/UFIEP/JD80Jv3Ch9o/yty WUpwjLm4yIe/WllVsvspqxPxi8TG58Qx1JQdBuqE3LHJ0nyKg6JdCvYvB4uKtmzSOKLy TDMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id g92si2124389qva.34.2018.11.19.02.17.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 02:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F26A307D842; Mon, 19 Nov 2018 10:17:22 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-77.ams2.redhat.com [10.36.117.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E6B8105706D; Mon, 19 Nov 2018 10:17:14 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devel@linuxdriverproject.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, xen-devel@lists.xenproject.org, kexec-ml , pv-drivers@vmware.com, David Hildenbrand , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH v1 8/8] PM / Hibernate: exclude all PageOffline() pages Date: Mon, 19 Nov 2018 11:16:16 +0100 Message-Id: <20181119101616.8901-9-david@redhat.com> In-Reply-To: <20181119101616.8901-1-david@redhat.com> References: <20181119101616.8901-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 19 Nov 2018 10:17:22 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The content of pages that are marked PG_offline is not of interest (e.g. inflated by a balloon driver), let's skip these pages. Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Len Brown Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Acked-by: Pavel Machek Signed-off-by: David Hildenbrand Acked-by: Rafael J. Wysocki --- kernel/power/snapshot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 87e6dd57819f..8d7b4d458842 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1222,7 +1222,7 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn) BUG_ON(!PageHighMem(page)); if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page) || - PageReserved(page)) + PageReserved(page) || PageOffline(page)) return NULL; if (page_is_guard(page)) @@ -1286,6 +1286,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 (PageOffline(page)) + return NULL; + if (PageReserved(page) && (!kernel_page_present(page) || pfn_is_nosave(pfn))) return NULL;