From patchwork Thu Nov 22 10:06:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10693817 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 360B313AD for ; Thu, 22 Nov 2018 10:07:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2548E2BA1E for ; Thu, 22 Nov 2018 10:07:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16B212BAB3; Thu, 22 Nov 2018 10:07:12 +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 915152BA1E for ; Thu, 22 Nov 2018 10:07:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C7116B2AFA; Thu, 22 Nov 2018 05:07:10 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 84EFE6B2AFB; Thu, 22 Nov 2018 05:07:10 -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 718396B2AFC; Thu, 22 Nov 2018 05:07:10 -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 432986B2AFA for ; Thu, 22 Nov 2018 05:07:10 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id v74so8811381qkb.21 for ; Thu, 22 Nov 2018 02:07:10 -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=UA6l3DzDadDMnwPbS9tEgX3L9W8fYEXH2beRMhqpa8qmH/TPg1x9fDXnMx9V2rxUTy TcL9Dy1Unp+We8kPbBnQFKor2aYjFd53KPAbNF/kDE1g/cuhUhwG+6GLwkL0Y+9H9YLJ Gb65Z0BfR2KHv+YDkL4bljwNXjm1fGfJDW2W809AqNK8qCp7BaM5cKM/M0F92d1MTYIy GnQdQTwPRovcqmDUZmnmRi+J+uNP+Sk3EALmTMKzz16O0CkhIcj/I41SZPbXjlRPj+9A Rns8H3jGOMwWSJF9Dfvyp0JsXHuFs2/b+TJWvls1p8mvfIOq8ZroWgOeXFfi0s1FeqQy C1dg== 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+aEWb12QUgVl3XaXiznjyU5vP5x5g7EmmgbZKFyBNG4ZnYidNUC/eD 2vtDJHQM+jcolJskIISikBppvJmN+x9XkjA8gvKhrjwnpxAFlJEJ5bX6N7UeCo6a1TwLMMvImBH FrBBqgC0/hhNjg5YoiDQBP0DvWjxaqlF3hzT4F3b2VaOydqOKHMoQaQCwu7zlGvOuWQ== X-Received: by 2002:aed:29c7:: with SMTP id o65mr9398251qtd.353.1542881230057; Thu, 22 Nov 2018 02:07:10 -0800 (PST) X-Google-Smtp-Source: AJdET5fM3ygTT4lvnv8OBIPjHpXhb7O4AucXMcA1UMBunQZ2AKYxYXaga1AH4zEedvkv5CUIS7MC X-Received: by 2002:aed:29c7:: with SMTP id o65mr9398206qtd.353.1542881229291; Thu, 22 Nov 2018 02:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542881229; cv=none; d=google.com; s=arc-20160816; b=M95zSITLHqSO+HFUC3MQBRowYcbEvVwWfX7MltFZ1L14nYZp/36KfpqeOZa/dEAOxC va3o5rHCenQG9plSw8UY1RluLOf2ECUCcvgBkpZ8/fPcZ+9yWHij/wh0niReS2Alxm6y 9BJJ8AE8USjNOCD/qxOiFCFPNZv0+W6Z5T32f1LaAUitaxGrPZGmnoy36xkhZ8jrhVzO DcQT/5GeaG/HG0aHfkVxlZNiZykNg4WoG/4HIA2V2WYXLRPh7916T6/mnvBOB3Ek+lFr OLFm2i/rhYwZRbu8muuS6CAVqWkflNnDxJVkyq+XjDo08NHeHC3QELxjChCFQ8Fn8oym ANtQ== 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=ggLeqO5zYlrkjcyxWO8S3YJ+012oZFYYy2Y/SksA74Q8qsLys6DEbAzY6Xc/qEW4go Z5Zv9SfADM3qg+cfIGvyKbgb0K/W0KWgzMa2DDHgkNNZgTQuiGu8AaID/hROhv3RVztt cyArjAhlTiDeqVlXj/ug9ROBIL+ZuuwcmOAv5zqX6A3e98XyQToyhdl6hwrZMgVMJhgI l5zncByY9nblt9r1NXmf+X2kzMasQlXmT8iiDES/Xtzx3h8k18Y406Ml/abIAFmW0W8Y GUo3fmpJ2ejKrRFtoypLYK69bA1tTIWeNcWU4aUI0Ji1A0Ikk8Af62uilcE1RPU8lrGC /+kw== 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 o61si5363344qte.74.2018.11.22.02.07.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 02:07:09 -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 5B36DC04FF86; Thu, 22 Nov 2018 10:07:08 +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 3C32B16BE8; Thu, 22 Nov 2018 10:07:00 +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 , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Andrew Morton , Matthew Wilcox , Michal Hocko , "Michael S. Tsirkin" Subject: [PATCH v2 4/8] xen/balloon: mark inflated pages PG_offline Date: Thu, 22 Nov 2018 11:06:23 +0100 Message-Id: <20181122100627.5189-5-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.31]); Thu, 22 Nov 2018 10:07:08 +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 Reviewed-by: Juergen Gross --- 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);