Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8034163ybn; Tue, 1 Oct 2019 02:03:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxUOoU95hztX+gETHaTmeG09pbZQoBXx2wQWkDHr3VId+juze/7OTZ0kJ60Lyc6K2okxww X-Received: by 2002:a17:906:768f:: with SMTP id o15mr22723492ejm.42.1569920613183; Tue, 01 Oct 2019 02:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569920613; cv=none; d=google.com; s=arc-20160816; b=lhgCCDYy4BDmoid34PARoKSj+HQ1tk+5bkiIKXuNXfK/l5sOqiJ8Vann9zd9X04gVP 7TRZj7FyRg4tPDtFElAx4i7x3Q31lxjufizvxsjV9pPq39loE2nERnQGlUhwXlWAsbek 3xUfULYhkAl9F+zgh+FI8ktggpAUYIRbzm5fJ4wW+vhajcx98tfs4Npo514eOGCWzC75 ljLubHVO20O8u4XlgbVTB82CgyKWxmjMcjHMqcVnjzZGmrmC3Xl45Dz8Z5BZPTLPzrFK pmxsLb3lWeD7/032riGAyWDqN6+Rsdtd7FLrjs9vhXpG4T2RI2jhACuByiBfrnpHuPJ+ h72w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CfAP8f81ImGAfXzz3b8O3FPuzKV9ak9X9uuaUR1H2p8=; b=TVGkFybqk6lZT1QpsLbWhfv1Tww2kdMvt/Ndkzpf1GyiZMqo39ybgPRBCGOIBJuPyV UXVCCu69AiQ4sGZLW+eUjKQAJDP3vJ0j71qxnFL/FHJKN3r1NS6fPOMoqeDLHWwz9Dv5 fPCxklyN40y7cOMDUmPb09S1x+owQomyPJ8iYWBTqsZxYiIRASpm8XJT50XzZRsWfUac znS5pzKLVtjlL+E1Lpcyh/U2o4NP2hkL+Snjde3dYiSoeD3fg+DqVGJLlSd2LA+UfUWF LkXslx4MGd/w7mZS7nJmGg9nhfYiP+vczdyEQcMcELl3cJ+e1IOU1PiuUFRRiMveRDzk OAzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si5546501ejb.303.2019.10.01.02.03.08; Tue, 01 Oct 2019 02:03:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733248AbfJAJCG (ORCPT + 99 others); Tue, 1 Oct 2019 05:02:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41530 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729787AbfJAJCF (ORCPT ); Tue, 1 Oct 2019 05:02:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0702373A62; Tue, 1 Oct 2019 09:02:05 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-182.ams2.redhat.com [10.36.117.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 824F0611DE; Tue, 1 Oct 2019 09:02:01 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, xen-devel@lists.xenproject.org, David Hildenbrand , Boris Ostrovsky , Juergen Gross , Stefano Stabellini Subject: [PATCH v1 3/3] xen/balloon: Clear PG_offline in balloon_retrieve() Date: Tue, 1 Oct 2019 11:01:52 +0200 Message-Id: <20191001090152.1770-4-david@redhat.com> In-Reply-To: <20191001090152.1770-1-david@redhat.com> References: <20191001090152.1770-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 01 Oct 2019 09:02:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's move the clearing to balloon_retrieve(). In bp_state increase_reservation(), we now clear the flag a little earlier than before, however, this should not matter for XEN. Suggested-by: Boris Ostrovsky Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Signed-off-by: David Hildenbrand --- drivers/xen/balloon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 8c245e99bb06..5bae515c8e25 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -189,6 +189,7 @@ static struct page *balloon_retrieve(bool require_lowmem) else balloon_stats.balloon_low--; + __ClearPageOffline(page); return page; } @@ -440,7 +441,6 @@ 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); } @@ -606,7 +606,6 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages) while (pgno < nr_pages) { page = balloon_retrieve(true); if (page) { - __ClearPageOffline(page); pages[pgno++] = page; #ifdef CONFIG_XEN_HAVE_PVMMU /* -- 2.21.0