From patchwork Thu Nov 22 10:06:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10693835 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 E2D5613AD for ; Thu, 22 Nov 2018 10:07:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D17A42BA1E for ; Thu, 22 Nov 2018 10:07:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5A4D2BAB3; Thu, 22 Nov 2018 10:07:33 +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 469012BA1E for ; Thu, 22 Nov 2018 10:07:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36DA76B2B04; Thu, 22 Nov 2018 05:07:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 31D0A6B2B05; Thu, 22 Nov 2018 05:07:32 -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 1983E6B2B06; Thu, 22 Nov 2018 05:07:32 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id DF7646B2B04 for ; Thu, 22 Nov 2018 05:07:31 -0500 (EST) Received: by mail-qt1-f200.google.com with SMTP id w15so5840107qtk.19 for ; Thu, 22 Nov 2018 02:07:31 -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=eiWDEEk22vBkyyp8M3BvlsYM+ovUhtbTV2FeGMbkcp4=; b=gLQswh2gBZzUry4uxbR9ufH0oNCfLWgnAACqYQE4F4asde1jdNYes4EO1AuU2LyRaR eCYjBhHv5qP3YwV8NihEUQpv5gX8jk4AnGVpxX4ZiaczRc0cOmCGtr88f2HqMj4R0syt lMCZ6wUinkWDO0WOCvoZoqpgIWm4cSm6D0Ls240ZB4EHHhStXc/pJFISIvSHPBw8EFFP 7XS96+oFSdUlQ+frNT9AvribAe1R3a/Tw455ctsWRA/FfFyLFT/1bxuyAHTvPDK4w91w e9Q1Jn1GmjKBrQgqwEGc3a5xl5RkhfFkGXJdQmA9AR8XdozXLuc9GRD5Vh+10vuP2B8L Z8Og== 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: AA+aEWZMhW4FeJsrO9wif2qV3hLJSXu3j+eVrylJgSzEz+HmtJv5xQ69 Rpqv6PiRa9e/TtFM7c7yHdDvchbnp9Oi4kfckFYS8GwBI+UPKBvnDxbK0fWm+WEUsmP1xNmNM2E x2t5Mp+mY+N2p1dMTwUGdu6gu+n4gl5jqlJFO04VEgwjoSbtjNTX+1MG7Ae53+O1J7A== X-Received: by 2002:ac8:2b42:: with SMTP id 2mr9130398qtv.255.1542881251668; Thu, 22 Nov 2018 02:07:31 -0800 (PST) X-Google-Smtp-Source: AJdET5drAFI+PQSuDVFIHjF71G/wWgGFabIhdcxSBV23tvtkD5yfQAHycodI6dOrtzMCiV4yVSt2 X-Received: by 2002:ac8:2b42:: with SMTP id 2mr9130371qtv.255.1542881251081; Thu, 22 Nov 2018 02:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542881251; cv=none; d=google.com; s=arc-20160816; b=gXJffr1yKZOx4GibmTRDWGJ5m9UcUm6a4G++RfiOJu/qpN2iMwzOhXMiVqcq1BkiCQ rtR8W3UZWFNpBuYUEQW55aPGlrAN3kGxUYtOsZkxGM3V++rwd489geWY28bO4aAsJJqI QEnDiWohZlLiv90/6+O+vtdx4t5tjcY09our7SCZreRSGgp1+RCIAHR+L6o580bRBek8 XqEqcqXigE4Za2zo2jhtFcEj45AR88C92EBt73eCk0N1ygDtA7i6MapMVvBH/jicpbMw mJRtYe7+oqBCrra9bsmzrnc+QxTFYlCwUMFTPw30dCITNTXz3UOVNAPAe5oey9GhCG52 zaEw== 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=eiWDEEk22vBkyyp8M3BvlsYM+ovUhtbTV2FeGMbkcp4=; b=cJMxSGq3yB2yjTtJtSy3I7dFyHfg1kzr/WxnFwMRANczlKdhRSn3MMwGvNo9/ZZo2K BzECQskmBHSUuP6wKMtIR2qQQsuxhrmmxR6VrRLJ6ob88wPcmBpamfnJuZXkXUwk8NNj u3TvI9bALAQ16lLSA1leP7CojorOdSXjMwSjLjlhHdXQJhSYp2DKskD1KQ6mh5ZgzBfq Kk94o7bL1W8fRkkRrW+YYayna0STQXO1BTYNfK8/v5jW+pesLdx92XMNkkpzVMs+n06l z3Z6FRBBDbBiB1RIHRAFwg1hFs6iQ72Kn0nlDtiQGn/rcECb3GUumDNa4VjC54ctpvat Uwug== 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 o5si5751555qkh.112.2018.11.22.02.07.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 02:07:31 -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-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21022306B661; Thu, 22 Nov 2018 10:07:30 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-206.ams2.redhat.com [10.36.116.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D4D7282CD; Thu, 22 Nov 2018 10:07:23 +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 v2 8/8] PM / Hibernate: exclude all PageOffline() pages Date: Thu, 22 Nov 2018 11:06:27 +0100 Message-Id: <20181122100627.5189-9-david@redhat.com> In-Reply-To: <20181122100627.5189-1-david@redhat.com> References: <20181122100627.5189-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 22 Nov 2018 10:07:30 +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. In saveable_highmem_page(), move the PageReserved() check to a new check along with the PageOffline() check to separate it from the swsusp checks. 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 Acked-by: Rafael J. Wysocki Signed-off-by: David Hildenbrand --- kernel/power/snapshot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 87e6dd57819f..4802b039b89f 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1221,8 +1221,10 @@ 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)) + if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page)) + return NULL; + + if (PageReserved(page) || PageOffline(page)) return NULL; if (page_is_guard(page)) @@ -1286,6 +1288,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;