From patchwork Wed Nov 14 21:16:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683095 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 A048414E2 for ; Wed, 14 Nov 2018 21:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938A52B6B5 for ; Wed, 14 Nov 2018 21:17:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879732BD32; Wed, 14 Nov 2018 21:17:29 +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 12A2E2B6B5 for ; Wed, 14 Nov 2018 21:17:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03CB16B0005; Wed, 14 Nov 2018 16:17:26 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EDB586B0006; Wed, 14 Nov 2018 16:17:25 -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 DCABE6B0008; Wed, 14 Nov 2018 16:17:25 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id AB0F16B0005 for ; Wed, 14 Nov 2018 16:17:25 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id h68so40836021qke.3 for ; Wed, 14 Nov 2018 13:17:25 -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=Oq7Mm7RstKCl5jwQdxJ6ybQMpWdJOGauvDFhhJ6+35E=; b=b0PuZVrZAvShnB/TrUGp/tO/3+nlw3bYksjseKWsuHDVB8RfDpicQDNq2QcGgTNTkQ BhhriQi1j5ee8k9arVaYtvT+51uJ4XA8DCdscKbAhwkzcOhmKtco/mkYV0DCxP1edlq4 5WuvjPl1sBC+EwXG4lu1dpGS2WAvoLf/oozfY2vETak1IpN5VDyH5kzyd2RK1TWITcU4 LwWA2lJAy4O9NgCobUiA1YwlU67ShGPsD/mwjim5l/qh6kCY9gCp28UPlDnbuDvLsWr0 Vp/rNEXw52W41LqJnYKVfwDVDPssw13iFZu0AklSR1wJ+WOFUVG3Z5+zatOSg4eT9at9 SoBg== 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: AGRZ1gL4jP5M3TekeXHbv4q2qa9QxKALI3fVCMGiFvluAgENsQWhUrpR taSupguSTY3Sgkk7E4NnSwyHjCqPE1FAqpR98cRDUPvRizYzfSAPWIx99QSmXLz8U2CF8/biFzf 6Kx2oc9gSdpJJGBHE330ToPoTjHY2YyaGYeBaw3wkGLlIXrCDvrf4DtGNGCDRN3CrFQ== X-Received: by 2002:a0c:d40f:: with SMTP id t15mr3589124qvh.117.1542230245413; Wed, 14 Nov 2018 13:17:25 -0800 (PST) X-Google-Smtp-Source: AJdET5fmCBAPTO8d8GYMnXiSLT+55l2ZPEOmZ/WUwpYDLWiv/StJQJMgd4pszY3p9QCZGKDbstXF X-Received: by 2002:a0c:d40f:: with SMTP id t15mr3589097qvh.117.1542230244830; Wed, 14 Nov 2018 13:17:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230244; cv=none; d=google.com; s=arc-20160816; b=GkkcCoy8jJBBXugINk3vEtIYAKm6/efcJSpAJ/L6mp2RzukuYt1d8acT7gHTzMSS+Q OiHlkTf7PkxcQ+XAvAOxREsnwqoXRvD8DvSR3YARp3ujPs4Dwf0Ir/YItA7npwRfkORo tTS6CojdxIO3/0yHvREdn3f+qjM7DwU6xyfHWcLpc0jMWkbMhPP2aNTqzjvW1c7ziGJe 2Tw/EYuTTThmHMUACI95CuUX16JC4lJ/g4xMBqKFJHZUB9EzlqSm3cCBUwylRprj7moA /xD6MBGgVv8aHAXmfcBJUw1+jbLK5fBhNXXO6osz6yVrW1l2YbQx8crc0XieRakLPL0g n6tg== 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=Oq7Mm7RstKCl5jwQdxJ6ybQMpWdJOGauvDFhhJ6+35E=; b=JZ49T8DqGMxHGmfJWbHdV479+cnpQ7Of75cxWF1zNRFgdkQ751yiW7jr9WU6nKnw43 rE7av5re3tlmTfDt36x8SMD5ACW762MYNhbHKOgAZqqsdbNO0qnHPAsOnRKsT2k8ryzI kC4nqklmSgf+VsayktgAEQOj5Aww7x9+RJYx5REJDobpR7FE5JTBgoxZrq8LHkqodtio wvalN/YvAeHrl2jZntVp/vrmfapMw33cIrcahGGNqN2pcmM6J8URxFtoicBMCb2W4vxM wmxDtSwE3+ooiYn7xgnftCP//UKch4CNwujhBToecgqfEI1FJae04aI2LWBpygOVmj+H 6WuQ== 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 v11si1033342qvj.128.2018.11.14.13.17.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:17:24 -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 AA7332D814; Wed, 14 Nov 2018 21:17:23 +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 578C761487; Wed, 14 Nov 2018 21:17:21 +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 , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH RFC 1/6] mm: balloon: update comment about isolation/migration/compaction Date: Wed, 14 Nov 2018 22:16:59 +0100 Message-Id: <20181114211704.6381-2-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.30]); Wed, 14 Nov 2018 21:17:23 +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 Commit b1123ea6d3b3 ("mm: balloon: use general non-lru movable page feature") reworked balloon handling to make use of the general non-lru movable page feature. The big comment block in balloon_compaction.h contains quite some outdated information. Let's fix this. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- include/linux/balloon_compaction.h | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h index 53051f3d8f25..cbe50da5a59d 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon_compaction.h @@ -4,15 +4,18 @@ * * Common interface definitions for making balloon pages movable by compaction. * - * Despite being perfectly possible to perform ballooned pages migration, they - * make a special corner case to compaction scans because balloon pages are not - * enlisted at any LRU list like the other pages we do compact / migrate. + * Balloon page migration makes use of the general non-lru movable page + * feature. + * + * page->private is used to reference the responsible balloon device. + * page->mapping is used in context of non-lru page migration to reference + * the address space operations for page isolation/migration/compaction. * * As the page isolation scanning step a compaction thread does is a lockless * procedure (from a page standpoint), it might bring some racy situations while * performing balloon page compaction. In order to sort out these racy scenarios * and safely perform balloon's page compaction and migration we must, always, - * ensure following these three simple rules: + * ensure following these simple rules: * * i. when updating a balloon's page ->mapping element, strictly do it under * the following lock order, independently of the far superior @@ -21,19 +24,8 @@ * +--spin_lock_irq(&b_dev_info->pages_lock); * ... page->mapping updates here ... * - * ii. before isolating or dequeueing a balloon page from the balloon device - * pages list, the page reference counter must be raised by one and the - * extra refcount must be dropped when the page is enqueued back into - * the balloon device page list, thus a balloon page keeps its reference - * counter raised only while it is under our special handling; - * - * iii. after the lockless scan step have selected a potential balloon page for - * isolation, re-test the PageBalloon mark and the PagePrivate flag - * under the proper page lock, to ensure isolating a valid balloon page - * (not yet isolated, nor under release procedure) - * - * iv. isolation or dequeueing procedure must clear PagePrivate flag under - * page lock together with removing page from balloon device page list. + * ii. isolation or dequeueing procedure must remove the page from balloon + * device page list under b_dev_info->pages_lock. * * The functions provided by this interface are placed to help on coping with * the aforementioned balloon page corner case, as well as to ensure the simple From patchwork Wed Nov 14 21:17:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683101 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 44D3714E2 for ; Wed, 14 Nov 2018 21:17:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35F972B6B5 for ; Wed, 14 Nov 2018 21:17:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29FA62BD32; Wed, 14 Nov 2018 21:17:37 +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 DE3142B6B5 for ; Wed, 14 Nov 2018 21:17:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E40DA6B000A; Wed, 14 Nov 2018 16:17:33 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DF1426B000C; Wed, 14 Nov 2018 16:17:33 -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 CB9276B000D; Wed, 14 Nov 2018 16:17:33 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 99ED16B000A for ; Wed, 14 Nov 2018 16:17:33 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id k203so40815831qke.2 for ; Wed, 14 Nov 2018 13:17:33 -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=RRzTLikkIj/cL+Vufoc8Xsid2bt18phMT3MICGSMy48=; b=AYsDOoIhiAhnilBu1b9Qe37DTLvu3NF2PBxPUckpEV8ioSrJrgDupvgOotQg0jSnxI 0pnrs+Z6ZPUdS4cVLEv4nD4482lOFlveYWRjRXbMX5VNRdf6vm/qsK2ZDt9XfavMN42h /y1fIIieHLk0oqSoepmmqcIZ9Rp+82Vmim0FTqoFANLeLAtL3DSztROXt5OH1CJ/ymO6 di7l0W8/ouw7GbAjc267tWlPvhDz/gtCIOiWkJtYrlI/vdFjTJzp9yWlPygp3yECNEUg rmJx8prvEud+z2zc9a7vtgGtLlI9cFYEIYK/FYMBuBJqJ2Wz+vR95lweFCrRCNUWKOgI Uo4A== 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: AGRZ1gILUDDbKvRKSuwI9YvwTF2BkX2Ky2VfQey23C1g8oJjptynuLsG lV0l2/47m78hNLNZi/ZUf90mHQ9VLdVfBuzeh8XwEQms2SqbGRueqIrBTQtP8MqSVRzOsqL8ied wDzw0MQZzD597gDzTVND5AyM4Pdm9tVJ1QiirBCiCHhb3fhOZYw41BFRMj/IANzNO0w== X-Received: by 2002:aed:2185:: with SMTP id l5mr3519927qtc.276.1542230253302; Wed, 14 Nov 2018 13:17:33 -0800 (PST) X-Google-Smtp-Source: AJdET5e9jgh0SCm/HVowMX3PpEGnJjRdUdMkOUkBtKVneM5FrT/N9m66Nt5a/RTld1klhyU2WMpH X-Received: by 2002:aed:2185:: with SMTP id l5mr3519888qtc.276.1542230252602; Wed, 14 Nov 2018 13:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230252; cv=none; d=google.com; s=arc-20160816; b=Ru9ngKJbWe1GMRuaRuvGy41E1Q6VkNFtlnE+Tx4LnpKmNpXEyTGamkwjiKyu43lirk t5hlyMj3t1jGbAX9HZjRO64RGgSx7FiY5qGgmQiBFL5ET0TbDXAyWcCWhCjY1QEemJ6s H4U6rwYIvFbVCuBuYUrlsMJUE5xAVOonrE5Ppc7tx4aj2AwbQFNjF6JAYVBaHpTWRh3P 3VRu35/8DRhYXlbOwyN0UEuUKjF4J1GOtxE9YvlC1NDqGN9A+0kUC1kkcWnJE3BAKny6 Oq7HmIJnwnRm8IknJva1FcDMFJ2OzjiNxQS4cSm5xHku8Oz9HrLZqGCvVQZOkgZVcEyH 1BEw== 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=RRzTLikkIj/cL+Vufoc8Xsid2bt18phMT3MICGSMy48=; b=DQLBaltQ4qlbuP+2ueEXC2seSGJRb60Ac6jv3IVUi9iI34DTmdfawG35XGKyHgs9By Y2h3KlLhHa00AP47zr9yWQOA3Kl3oV5SbQqPkGarh0MDNzLb0c1PtRUCWjHAE4OMx6Hi LhII8CtfSzu5CnQ1io300fLCD/cb5GiOWpgd2j0GqAFpMo9aK2WK1WVYNhV5pL+q3tcC A/ByaubJWDburLb6Rq/EugAQzI+Q3L/6MG7TVDpGZXonRt1SH1VpqpSCmc0PlU17Etut S3Hm+/k5WM6XiWE9mODJ6etb9Xx6a2IprbuUlCawV7Sv8xJSlJ68yfPioPAkfrwva+dv QABQ== 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 s127si6479857qkc.45.2018.11.14.13.17.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:17:32 -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 15971300272A; Wed, 14 Nov 2018 21:17:31 +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 07EDE5C8A4; Wed, 14 Nov 2018 21:17: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, David Hildenbrand , Jonathan Corbet , Alexey Dobriyan , Mike Rapoport , Andrew Morton , Christian Hansen , Vlastimil Babka , "Kirill A. Shutemov" , Stephen Rothwell , Matthew Wilcox , "Michael S. Tsirkin" , Michal Hocko , Pavel Tatashin , Alexander Duyck , Naoya Horiguchi , Miles Chen , David Rientjes Subject: [PATCH RFC 2/6] mm: convert PG_balloon to PG_offline Date: Wed, 14 Nov 2018 22:17:00 +0100 Message-Id: <20181114211704.6381-3-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.46]); Wed, 14 Nov 2018 21:17:31 +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 PG_balloon was introduced to implement page migration/compaction for pages inflated in virtio-balloon. Nowadays, it is only a marker that a page is part of virtio-balloon and therefore logically offline. We also want to make use of this flag in other balloon drivers - for inflated pages or when onlining a section but keeping some pages offline (e.g. used right now by XEN and Hyper-V via set_online_page_callback()). We are going to expose this flag to dump tools like makedumpfile. But instead of exposing PG_balloon, let's generalize the concept of marking pages as logically offline, so it can be reused for other purposes later on. Rename PG_balloon to PG_offline. This is an indicator that the page is logically offline, the content stale and that it should not be touched (e.g. a hypervisor would have to allocate backing storage in order for the guest to dump an unused page). We can then e.g. exclude such pages from dumps. In following patches, we will make use of this bit also in other balloon drivers. While at it, document PGTABLE. Cc: Jonathan Corbet Cc: Alexey Dobriyan Cc: Mike Rapoport Cc: Andrew Morton Cc: Christian Hansen Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: Stephen Rothwell Cc: Matthew Wilcox Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Pavel Tatashin Cc: Alexander Duyck Cc: Naoya Horiguchi Cc: Miles Chen Cc: David Rientjes Signed-off-by: David Hildenbrand --- Documentation/admin-guide/mm/pagemap.rst | 6 ++++++ fs/proc/page.c | 4 ++-- include/linux/balloon_compaction.h | 8 ++++---- include/linux/page-flags.h | 11 +++++++---- include/uapi/linux/kernel-page-flags.h | 1 + tools/vm/page-types.c | 1 + 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/mm/pagemap.rst b/Documentation/admin-guide/mm/pagemap.rst index 3f7bade2c231..9afd6bdc424b 100644 --- a/Documentation/admin-guide/mm/pagemap.rst +++ b/Documentation/admin-guide/mm/pagemap.rst @@ -78,6 +78,8 @@ number of times a page is mapped. 23. BALLOON 24. ZERO_PAGE 25. IDLE + 26. PGTABLE + 27. OFFLINE * ``/proc/kpagecgroup``. This file contains a 64-bit inode number of the memory cgroup each page is charged to, indexed by PFN. Only available when @@ -128,6 +130,10 @@ Short descriptions to the page flags Note that this flag may be stale in case the page was accessed via a PTE. To make sure the flag is up-to-date one has to read ``/sys/kernel/mm/page_idle/bitmap`` first. +26 - PGTABLE + page is in use as a page table +27 - OFFLINE + page is logically offline IO related page flags --------------------- diff --git a/fs/proc/page.c b/fs/proc/page.c index 6c517b11acf8..378401af4d9d 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -152,8 +152,8 @@ u64 stable_page_flags(struct page *page) else if (page_count(page) == 0 && is_free_buddy_page(page)) u |= 1 << KPF_BUDDY; - if (PageBalloon(page)) - u |= 1 << KPF_BALLOON; + if (PageOffline(page)) + u |= 1 << KPF_OFFLINE; if (PageTable(page)) u |= 1 << KPF_PGTABLE; diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h index cbe50da5a59d..f111c780ef1d 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon_compaction.h @@ -95,7 +95,7 @@ extern int balloon_page_migrate(struct address_space *mapping, static inline void balloon_page_insert(struct balloon_dev_info *balloon, struct page *page) { - __SetPageBalloon(page); + __SetPageOffline(page); __SetPageMovable(page, balloon->inode->i_mapping); set_page_private(page, (unsigned long)balloon); list_add(&page->lru, &balloon->pages); @@ -111,7 +111,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon, */ static inline void balloon_page_delete(struct page *page) { - __ClearPageBalloon(page); + __ClearPageOffline(page); __ClearPageMovable(page); set_page_private(page, 0); /* @@ -141,13 +141,13 @@ static inline gfp_t balloon_mapping_gfp_mask(void) static inline void balloon_page_insert(struct balloon_dev_info *balloon, struct page *page) { - __SetPageBalloon(page); + __SetPageOffline(page); list_add(&page->lru, &balloon->pages); } static inline void balloon_page_delete(struct page *page) { - __ClearPageBalloon(page); + __ClearPageOffline(page); list_del(&page->lru); } diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 50ce1bddaf56..f91da3d0a67e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -670,7 +670,7 @@ PAGEFLAG_FALSE(DoubleMap) #define PAGE_TYPE_BASE 0xf0000000 /* Reserve 0x0000007f to catch underflows of page_mapcount */ #define PG_buddy 0x00000080 -#define PG_balloon 0x00000100 +#define PG_offline 0x00000100 #define PG_kmemcg 0x00000200 #define PG_table 0x00000400 @@ -700,10 +700,13 @@ static __always_inline void __ClearPage##uname(struct page *page) \ PAGE_TYPE_OPS(Buddy, buddy) /* - * PageBalloon() is true for pages that are on the balloon page list - * (see mm/balloon_compaction.c). + * PageOffline() indicates that the pages is logically offline although the + * containing section is online. (e.g. inflated in a balloon driver or + * not onlined when onlining the section). + * The content of these pages is effectively stale. Such pages should not + * be touched (read/write/dump/save) except by their owner. */ -PAGE_TYPE_OPS(Balloon, balloon) +PAGE_TYPE_OPS(Offline, offline) /* * If kmemcg is enabled, the buddy allocator will set PageKmemcg() on diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h index 21b9113c69da..6c662eb0dab8 100644 --- a/include/uapi/linux/kernel-page-flags.h +++ b/include/uapi/linux/kernel-page-flags.h @@ -36,5 +36,6 @@ #define KPF_ZERO_PAGE 24 #define KPF_IDLE 25 #define KPF_PGTABLE 26 +#define KPF_OFFLINE 27 #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index 37908a83ddc2..b219c2eafd6a 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -137,6 +137,7 @@ static const char * const page_flag_names[] = { [KPF_PGTABLE] = "g:pgtable", [KPF_ZERO_PAGE] = "z:zero_page", [KPF_IDLE] = "i:idle_page", + [KPF_OFFLINE] = "o:offline", [KPF_RESERVED] = "r:reserved", [KPF_MLOCKED] = "m:mlocked", From patchwork Wed Nov 14 21:17:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683109 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 56EE014BA for ; Wed, 14 Nov 2018 21:17:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 494352B6B5 for ; Wed, 14 Nov 2018 21:17:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D5582B9C6; Wed, 14 Nov 2018 21:17:50 +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 CD0712B6B5 for ; Wed, 14 Nov 2018 21:17:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E41366B000D; Wed, 14 Nov 2018 16:17:48 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DF0826B000E; Wed, 14 Nov 2018 16:17:48 -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 CDF9E6B0010; Wed, 14 Nov 2018 16:17:48 -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 A55616B000D for ; Wed, 14 Nov 2018 16:17:48 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id y83so40099579qka.7 for ; Wed, 14 Nov 2018 13:17:48 -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=7ruAZHqQ0sPulerJ+Cgh2XJaAVK7EPCZD8dz6/M4Z64=; b=th76NtPn4EQkM5caC2wdBJNL73+VraDpUT8QgTBtrua3pCj6wZqCHUvKO4J4z8UFcJ RLUHqboC7rHQdoxA4VbBkfrtw7xfY8JqgqPigwSPwXiOd7lOBuS9N3meoMbjWRPmN9P4 YZIHqIUCQbKd6hxPBFrvrooUWVHoF0foPJumsZXdQIauqIk5XWRJU6WoW8hXtmibDGp+ 5BuFkfTtTzjks/wJBb5iJSUaLcCUL7X8QmDrv6PydYecpCvbtKWb3ysbjTez0uCNQadl tbFf56MZvpObq5HYsDVtJ5VnXuLj5pWDTDwLwiMu58l9aSsidEZYp13szKbRwPv7lqur nOBQ== 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: AGRZ1gJLuTjtVBFZUcno+lgqsyBxs0puYziwhMImxAADcOpP/4sO22AA h9j1j/ch7myF6H21r8PhM4IhThPRbc3zRkpRjqornI6+5zgif4sjxHj7vuA7EoPXF9WcgGjrFdX nNwFzG6OTkItLum24t3YwVNwkH7mza31ctzPGNOzZ4y0oaTlX2jE4pJNqXE7a7Y45bQ== X-Received: by 2002:ac8:39c2:: with SMTP id v60mr3433243qte.142.1542230268433; Wed, 14 Nov 2018 13:17:48 -0800 (PST) X-Google-Smtp-Source: AJdET5ctnp+xqLe4aEHbjmvS5miXoqZZck1GN5je3JqT4QLjM7qKNRXLU+DTil01FlLc0QhwUHS3 X-Received: by 2002:ac8:39c2:: with SMTP id v60mr3433223qte.142.1542230267973; Wed, 14 Nov 2018 13:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230267; cv=none; d=google.com; s=arc-20160816; b=YGnp3L5W9hz405ve+1eNz7KDJiYz9PH26rAZ+dvNo4wQwqMK6Q1uTxRzXzKT3ofMz/ gpg1UiaEYDQV1A3LI1C7dns3tZpU4IM1f9RB90+Dxe03mq7QQ4dmbUv/Uv3RKnU00fIL n7/JrGkeI/HHQ3w8VQn2oJzlayhqFe9PUaqMSg/zOnH80LCVhkF19oDqHGYq5L12HEdm fO64L/oa/9L4DxfIrZW8JuF4Z57sMnVyjgjIykjK2o68UwaifhzpPZGrMZvTcfraBnFF 7lflXfGcMT1+tM7XN0y2B/tZgtL1oZvA2Fl00+rGTks+cZDWNvK1RLxFEW9ReAcH81kn kUJA== 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=7ruAZHqQ0sPulerJ+Cgh2XJaAVK7EPCZD8dz6/M4Z64=; b=qOf1dXdhbSppzBEIVOxAuZy8bRTmhnW91X+BpKjjfYLuns7ApW08E9aFcdp5ZL9Quz Y4Aw+RX+3+cX5IgF0Q/+FBhQTg/G8h5fAnsyZv5f1NQEox5v4QJAqo63nwsfpOA46ZQC AL5+VK2RqHdzIbNE3EyJrhw9shFHBqUYQC+gjLrirFo6zFhXmadC5W/6kkO0yYanpcGX wvRJyICZr/yJBepqBZzat168KfPBXBjblgERV7kWV9fYhWyRWKgHZZWedvIKtLPGrlTf jvdQjT2YDYUmilSabCX0EgqFuAS3s+pteoIQRi1JOyRXZRKYQC8yT7+YcJKndXydW85J Pubg== 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 n32si549496qtd.130.2018.11.14.13.17.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:17:47 -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 74AF130BF479; Wed, 14 Nov 2018 21:17:46 +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 6725361491; Wed, 14 Nov 2018 21:17:31 +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 , Andrew Morton , Dave Young , "Kirill A. Shutemov" , Baoquan He , Omar Sandoval , Arnd Bergmann , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH RFC 3/6] kexec: export PG_offline to VMCOREINFO Date: Wed, 14 Nov 2018 22:17:01 +0100 Message-Id: <20181114211704.6381-4-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:17:47 +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 Let's export PG_offline via PAGE_OFFLINE_MAPCOUNT_VALUE, so makedumpfile can directly skip pages that are logically offline and the content therefore stale. Cc: Andrew Morton Cc: Dave Young Cc: "Kirill A. Shutemov" Cc: Baoquan He Cc: Omar Sandoval Cc: Arnd Bergmann Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- kernel/crash_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 933cb3e45b98..093c9f917ed0 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -464,6 +464,8 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE); #ifdef CONFIG_HUGETLB_PAGE VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR); +#define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline) + VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE); #endif arch_crash_save_vmcoreinfo(); From patchwork Wed Nov 14 21:17:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683117 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 E88E614E2 for ; Wed, 14 Nov 2018 21:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC4832B6B5 for ; Wed, 14 Nov 2018 21:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEA492B9C6; Wed, 14 Nov 2018 21:18:01 +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 786EF2B90F for ; Wed, 14 Nov 2018 21:18:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B1476B0010; Wed, 14 Nov 2018 16:18:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 760616B0266; Wed, 14 Nov 2018 16:18:00 -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 650036B0269; Wed, 14 Nov 2018 16:18:00 -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 3CDDB6B0010 for ; Wed, 14 Nov 2018 16:18:00 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id a199so40320461qkb.23 for ; Wed, 14 Nov 2018 13:18:00 -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=Nxtv3n9rUX3Umq56CPsblAVXzZrf0zdjcbISE72CVEo=; b=QYzPvzZUA8nFgVDfE3QdF95ATKDEjSayBt1aUt+SX97fcUyUAmhPK14gPL69Mbgy3r r/lMIwc25DOChx6L6N7oxY+L7hTrdP7H47VmbqsPuUWbkALQNoI9WpN2qCUEGkergxYz buBxzx/S6HSlp29Y31ZEtyk30geZXLdm3Fs3IsaaUrXCdRwGhSm5Pl3yMACj6G2TBQsD 7kfOAUkSpmcGkzfi95frsUZqo1qz/YLwAPnyrAcMEZSF/EEo5aX/3NpsZwWXA+uMUB4w Y/fdWW9rmW9XQc9th+KqyKjkOdDNIrFfKFPG+Anatvt2Cc6Vxe45xXRXU/DLKokLYVh9 L3Cg== 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: AGRZ1gL+oFMHvioCNRj5broxoS8DT6/izTGvOJq7FCbKihxki6hX4B48 ck7sOhdnJEuLi0+f+LOvZRL4TGfXl7EvFB5QkTshjEdn1DWZhuJDaaFb2hNsLyr/4jYfapRDo9r M51dmYXv02A/L/ZUsKEAx441a5j4klhMqMBqmd6Lg//V1BhxPg723nzkSOrL/w9hTEQ== X-Received: by 2002:ac8:2614:: with SMTP id u20mr3518271qtu.28.1542230280006; Wed, 14 Nov 2018 13:18:00 -0800 (PST) X-Google-Smtp-Source: AJdET5dcQk1VY+ZME1DDO4/VV71iUOWg7+CmtxI1fTk60+S+Rl0ar6+iJMJogVvEntYZhEgCNufu X-Received: by 2002:ac8:2614:: with SMTP id u20mr3518249qtu.28.1542230279566; Wed, 14 Nov 2018 13:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230279; cv=none; d=google.com; s=arc-20160816; b=Rk8VnVB3wQc78aggadoHsg5m8q38rRRXoxgNdNcs49/QtbkaAS7Gu6PVBvRHJW8+gK ckwWHlPRTX6cTZSNQS2nU5QL+kCB9jzfq3V+PwmCjfC7jBWvU9lCMkrGOre1vTkH8HGv ESCFFslqBgTHxjfPs00YnZDaqnanx5A7kfG1HhNHnIJomLmUt1Ew7TJ+BC1DwdLifaQf 3GFCzCNwmGGAxXYr1Kpst4N/KMSVkoZ/P+JSsv9UAPVpXdZSErB9a/r8/ED5Z1bs1y1g b+OnrYOrbWXhOk4J8qwhLmht3jWWnM6sJMC5/eFZ6UrVrtshGmYw2QUW2/5dTuU7b8PG Up/A== 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=Nxtv3n9rUX3Umq56CPsblAVXzZrf0zdjcbISE72CVEo=; b=V1OGTBr7c7PD2Q99NXqajoHY9GLvM6f9yRJdO+leDV9pJnUs6ufib8FOun7oQiw5cV w4tIE3lrFhgELR1FGm7ZR9hUn4L/iWSAl8LGg5NL8ko6Custh30QOwDGK1Hh7GWAlzqC Wl9xpWvhZw2Hwymm4cyqH53hu3+FtODFT51bw+OKj/Wq+FuRjpaE/ckRb7tRq0RMz7HU Epgm3YAkuqDENshUm7rIHxUl6ow/eSAC0IwkL5+7l0k2U7nL9HmidJ266hUdCgviKapq JzPL6m7NKujdQFYCUisa5jCTynHtPhqAjOiC/+vEk9mN0rRrGb5XMT4UBCOSH50vo0YB 1LNA== 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 w128si8880236qkc.37.2018.11.14.13.17.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:17:59 -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 6CB3CC05250F; Wed, 14 Nov 2018 21:17:58 +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 C18FC61493; Wed, 14 Nov 2018 21:17:46 +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 , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH RFC 4/6] xen/balloon: mark inflated pages PG_offline Date: Wed, 14 Nov 2018 22:17:02 +0100 Message-Id: <20181114211704.6381-5-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.31]); Wed, 14 Nov 2018 21:17:58 +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 Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- drivers/xen/balloon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 12148289debd..14dd6b814db3 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -425,6 +425,7 @@ static int xen_bring_pgs_online(struct page *pg, unsigned int order) for (i = 0; i < size; i++) { p = pfn_to_page(start_pfn + i); __online_page_set_limits(p); + __SetPageOffline(p); __balloon_append(p); } mutex_unlock(&balloon_mutex); @@ -493,6 +494,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) xenmem_reservation_va_mapping_update(1, &page, &frame_list[i]); /* Relinquish the page back to the allocator. */ + __ClearPageOffline(page); free_reserved_page(page); } @@ -519,6 +521,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) state = BP_EAGAIN; break; } + __SetPageOffline(page); adjust_managed_page_count(page, -1); xenmem_reservation_scrub_page(page); list_add(&page->lru, &pages); From patchwork Wed Nov 14 21:17:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10683123 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 0441A14E2 for ; Wed, 14 Nov 2018 21:18:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E95312B6B5 for ; Wed, 14 Nov 2018 21:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA4242B9C6; Wed, 14 Nov 2018 21:18:14 +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 6ED1B2B6B5 for ; Wed, 14 Nov 2018 21:18:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89B266B0269; Wed, 14 Nov 2018 16:18:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 84BAA6B026A; Wed, 14 Nov 2018 16:18:13 -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 73A516B026B; Wed, 14 Nov 2018 16:18:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 487786B0269 for ; Wed, 14 Nov 2018 16:18:13 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id f22so39875423qkm.11 for ; Wed, 14 Nov 2018 13:18:13 -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=TJailTWNXQpNDYEy03pHugK1Dve9JS7oIcI0CbKyKdw=; b=RxXwj3IdPQZEspqWreLwVarLfry8rttCLmxBrugSzpHlOW9+WfoPYx4w+ZQvya+rdf BpQ2Yj3WlgPlOpSV8hHVlPP4hZmc+Papk7mHru+JjzpJtS8mV1bHnzpl5uKzHnlVbtX/ UwUXxoZ5ohoHnszRZl6vkTHmIj/ewbk/MKEsEGIKGixdRysdOnwf2Tk2/3S6U0xF4FI7 S3NisEoM5Zt56jpeEIcvOD+jFq/iC/7ikfIdSs5q7nRQIlBpiLVW/W8grL3wztqxm2zp AjxnDoURpmagN+ekAoscijskezN7NooJH5l6q9CAUgXa/0ZbUsC0Xcr+1xzLc1yfTSK5 QwlQ== 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: AGRZ1gLeldewvhHBHVvEQAIJeR1Wihinr9ldSa90IV0FWgfu+JLMI+nh zsegqDmqqnnudEkaJ0OR28akbtXW8MavOJQjf6kS98YPM0S9MxTlMo46AOF6B1JcLMA5XBN2dNo sKFTZPY0lwQm7QxTxEBYbd9Ajn9jxISK8Ed1Gx3m8r3RJbufJGGMmem5OhRDuEMCFUQ== X-Received: by 2002:a0c:af73:: with SMTP id j48mr3588168qvc.172.1542230293059; Wed, 14 Nov 2018 13:18:13 -0800 (PST) X-Google-Smtp-Source: AJdET5dFHETVcR8uyFDFyRHg1LBf80WBPccMeag2IoxopTfNmLxCck9QNx4z7VIE3DomEJnAwBoO X-Received: by 2002:a0c:af73:: with SMTP id j48mr3588141qvc.172.1542230292586; Wed, 14 Nov 2018 13:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542230292; cv=none; d=google.com; s=arc-20160816; b=MZaTSeqvyM/8oLiCwJKAIOm6tfvye+K8+JWba9mC+snZPmrTLDHSV2tp7EYt1RMjbs 0hrPBzmQcryk5gmsAFw/jcYR+5y/Fjdt0BPMTyc/As+i/hE6cNQCF3A62Zve3O1R7QJy 9SdF6Wr9Sx+2y2iCMbbWz5/U+XXflyJL1UdsV9fB6MWZ4bBuHDhfze/HPUEQWUCZ9cdN GOQFP5UozmybOeOU+SF+GojzoZVbpWAzzCGU7y1tfTH5PKrh4NAZNySq1d0mQrfjXact vCCD8oO43Bx3nhYAL5FPS2KLGXKEybjr0k70lVF7+tdDThBuwKuSyP/BcWTn0GkgM2P3 BN8A== 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=TJailTWNXQpNDYEy03pHugK1Dve9JS7oIcI0CbKyKdw=; b=gjyPGtxzSYZzWk3Ta/mJaqPuooMAxy4dgPNpPr91MlnI/o3PxP4bWgt8PrFco4mfhY PxCT9uTSFDmxBnsyoys6LGwoWSG5SVcK91M304DNHTcYPU8XflfYkrm4xHRh1mKR08gA /uzux8vrVllQWAh1W16QPbhlqfi0SW/2BdvnhysYFe4KB8zQ7IFk0TM0jHjFMSw4fgdg 4zDZlyDpCSeS8EEK3z7mXC/UE+vDBbgvLrQ+gUnROoIdjCRFggmWC3bxp1dI5nswvZTF dOuHPR9G0ZIBMD4muUaouDWg1sxbt/ZxF25zJtr3MN+eBAiqkJaUTZ3mfEx0C7Ig8RMy Ifgg== 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 n2si4794505qvp.28.2018.11.14.13.18.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 13:18:12 -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 84CCF3154852; Wed, 14 Nov 2018 21:18:11 +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 BA65B5C8A4; Wed, 14 Nov 2018 21:17:58 +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 , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Kairui Song , Vitaly Kuznetsov , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH RFC 5/6] hv_balloon: mark inflated pages PG_offline Date: Wed, 14 Nov 2018 22:17:03 +0100 Message-Id: <20181114211704.6381-6-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.41]); Wed, 14 Nov 2018 21:18:11 +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 Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Kairui Song Cc: Vitaly Kuznetsov Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- drivers/hv/hv_balloon.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 5728dc470eeb..778b6f879d1c 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -681,8 +681,13 @@ static struct notifier_block hv_memory_nb = { /* Check if the particular page is backed and can be onlined and online it. */ static void hv_page_online_one(struct hv_hotadd_state *has, struct page *pg) { - if (!has_pfn_is_backed(has, page_to_pfn(pg))) + if (!has_pfn_is_backed(has, page_to_pfn(pg))) { + if (!PageOffline(pg)) + __SetPageOffline(pg); return; + } + if (PageOffline(pg)) + __ClearPageOffline(pg); /* This frame is currently backed; online the page. */ __online_page_set_limits(pg); @@ -1200,6 +1205,7 @@ static void free_balloon_pages(struct hv_dynmem_device *dm, for (i = 0; i < num_pages; i++) { pg = pfn_to_page(i + start_frame); + __ClearPageOffline(pg); __free_page(pg); dm->num_pages_ballooned--; } @@ -1212,7 +1218,7 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm, struct dm_balloon_response *bl_resp, int alloc_unit) { - unsigned int i = 0; + unsigned int i, j; struct page *pg; if (num_pages < alloc_unit) @@ -1244,6 +1250,10 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm, if (alloc_unit != 1) split_page(pg, get_order(alloc_unit << PAGE_SHIFT)); + /* mark all pages offline */ + for (j = 0; j < (1 << get_order(alloc_unit << PAGE_SHIFT)); j++) + __SetPageOffline(pg + j); + bl_resp->range_count++; bl_resp->range_array[i].finfo.start_page = page_to_pfn(pg); 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;