From patchwork Wed Nov 14 21:17:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683129 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 A182A14E2 for ; Wed, 14 Nov 2018 21:18:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93BEB2B6B5 for ; Wed, 14 Nov 2018 21:18:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85F3E2B9C6; Wed, 14 Nov 2018 21:18:22 +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=unavailable 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 29C462B6B5 for ; Wed, 14 Nov 2018 21:18:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 343B06B026B; Wed, 14 Nov 2018 16:18:21 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2F2F36B026C; Wed, 14 Nov 2018 16:18:21 -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 1BB986B026D; Wed, 14 Nov 2018 16:18:21 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id DE8B26B026B for ; Wed, 14 Nov 2018 16:18:20 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id n68so40144087qkn.8 for ; Wed, 14 Nov 2018 13:18:20 -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=ggEKTPs0WEV/jKKiJxHD/vnovOK+0e+ieowuDUjkBXU=; b=d4fNNLcvm2wUK2lzWuG4YHFzKF/b4MsFVR3jTYCC2q3/7K+bOADLVQ4zFVaot40yVj xw8J+aMvRFcSk5MQd/o8OdNd69X01M/BfcOQNm7ue/qHqKLRNYnZj2RMZSgO/nzJqYHB 9T6bYeuq+QlRm9A0T+PuJnOzz3LGKkrGLy0zI1ehWkU48wnT/oSt4mr3V1NxeZgFj8GP XcCtzmSvwJbiCJ2sg9DyedoiYIV81KAYBYPEEecN9j1gPyACoBAXowLHKLkya6y0eQ88 2E+f0+82IIwjqflOx3uF2cPpppIlvOUEA6SGU8BmdREqnRZxIM2lyBIcPvub4Pr4e7vZ nlcA== 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: AGRZ1gIZvJznig58+Gn8hexiX9L11hcX7A3GgApwoZQmTNUSG8xFz0tI Ki3ubOwXZnIcl+NllJUtk2Yay8V1SQ2a6tMcRr1yiKdePQuAnfsTlCvsFMBc7h/jpRzjxU6ouAS DwlXPyooLbkMoWO+wUjDG0z78jm73lhQOYe9SA0ZIo+1eXDh5NFRBzv5qUCBpTyXpeA== X-Received: by 2002:ac8:73c2:: with SMTP id v2mr3278424qtp.377.1542230300640; Wed, 14 Nov 2018 13:18:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fzyg+4LHrtJhEMpjpG4aj23EPS6KaQy6CbqUosKGh8iwxcvv/TWfaBk5OoNf3socibjpX0 X-Received: by 2002:ac8:73c2:: with SMTP id v2mr3278408qtp.377.1542230300108; Wed, 14 Nov 2018 13:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230300; cv=none; d=google.com; s=arc-20160816; b=IrxgiSHf2bQPheFt0LA2d0DEvhEgU5HnlWBhuLxGkOLwlZm1MDt/geXO5A+kTqmG0E nL4zNEyyziJvtS5SYRzNIAN4J4QNWUr6EdDKHA4M4KpxxteU0FlyG1pShX7a8y+z63B4 csPIh0XB32UFxhXyPhGy8uQTOLMcdrO2oq5Mv2cxikXgY/8iyTJbmxCgG5DRzLN7UY1I WGnwMrtk5hTAcpD1n2yofOh37z53kvD/tlq3iKgF1LaSJPBoSbpQ4XeyJF1k0zWvgOEc qCKjofhtmUTVVHisPeA6QePccaJ2j9VtiPvMZrBiV1QCAb/VMvCHc1bgZZxw9PlOh81s pfgg== 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=ggEKTPs0WEV/jKKiJxHD/vnovOK+0e+ieowuDUjkBXU=; b=Et7G3XL6UE4+aQ4Y4d7EiwBYqQHlY8Cit/7kucaMWWu+GkclafWDJQ8MvEHj9zRL6T erHla0Bo0yHyyK7hpGB/gturrt5kQ2lbB1LjloZAcKIt58ODMLVrkV1vLg/sxe5QX7BZ OoIh6vab8Oi4odg4TlmffQuSF/utUebkp8kTmD8l7DBL1kekU80Za6lUIjYKuT//Wcz0 XwOlO+1TuWGLdKX2pgLhJ+2VREuYEjloEU9SUl4t8LYwTLIte1nyJP/w5P3UokhZjv5b f7D0YWU7aO3+NRvadl7IJ42KIWoJvAq0VLNDelOKkduBkYQG+VICklITeJ5s9heqEooF muLQ== 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 j5si12297822qvi.95.2018.11.14.13.18.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:18:20 -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-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E285430024E1; Wed, 14 Nov 2018 21:18:18 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-99.ams2.redhat.com [10.36.116.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id CEBDA5C8A4; Wed, 14 Nov 2018 21:18:11 +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, David Hildenbrand , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH RFC 6/6] PM / Hibernate: exclude all PageOffline() pages Date: Wed, 14 Nov 2018 22:17:04 +0100 Message-Id: <20181114211704.6381-7-david@redhat.com> In-Reply-To: <20181114211704.6381-1-david@redhat.com> References: <20181114211704.6381-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 14 Nov 2018 21:18:19 +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" Signed-off-by: David Hildenbrand --- 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 b0308a2c6000..01db1d13481a 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;