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);