From nobody Tue Nov 11 05:41:24 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569920597; cv=none; d=zoho.com; s=zohoarc; b=nxlxn1JWDm4Zssqq1jVIRaFMc3jFhbFETHPYN6jL7CoHdfVhJ7VDMx86pCmvtzpEbfAi37/WIj+WUk+oXCjWr1LwS37vH4VMYGVlichOgcdo8MoVvpswBnJb7yAZrn/CSbTHkitdvZASdawxmba94PtZqqFUap7CruLAKFaZimM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569920597; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OsENo1pbTfDEpvXVKXJLaIXTr5Prz2I+ehDq2sbWkkA=; b=L8pzWhnDvqWcoKLSJorKa1IiupepAhL2Mn4ZHkuWoKiBc+zYZrw/Z1oIxu+IF/YBzBLUj25z7GavSpIDrvtNgRkzL/NBjQ614dIcwCYcmFXn0lf+ZgvjOkycrbcmQxW7hdMPJ6VCfjvIyo4/Gcln/4dBMmQ3IfZC7H/I+CQu+/A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569920597231228.36303299426766; Tue, 1 Oct 2019 02:03:17 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2p-0002tX-El; Tue, 01 Oct 2019 09:02:07 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2o-0002tR-Cj for xen-devel@lists.xenproject.org; Tue, 01 Oct 2019 09:02:06 +0000 Received: from mx1.redhat.com (unknown [209.132.183.28]) by localhost (Halon) with ESMTPS id 20698a56-e42a-11e9-97fb-bc764e2007e4; Tue, 01 Oct 2019 09:01:59 +0000 (UTC) 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 4F203554CD; Tue, 1 Oct 2019 09:01:59 +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 C8CA91D9; Tue, 1 Oct 2019 09:01:57 +0000 (UTC) X-Inumbo-ID: 20698a56-e42a-11e9-97fb-bc764e2007e4 From: David Hildenbrand To: linux-kernel@vger.kernel.org Date: Tue, 1 Oct 2019 11:01:50 +0200 Message-Id: <20191001090152.1770-2-david@redhat.com> In-Reply-To: <20191001090152.1770-1-david@redhat.com> References: <20191001090152.1770-1-david@redhat.com> MIME-Version: 1.0 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.25]); Tue, 01 Oct 2019 09:01:59 +0000 (UTC) Subject: [Xen-devel] [PATCH v1 1/3] xen/balloon: Drop __balloon_append() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , David Hildenbrand , linux-mm@kvack.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Let's simply use balloon_append() directly. Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Signed-off-by: David Hildenbrand Reviewed-by: Boris Ostrovsky --- drivers/xen/balloon.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 91cba70b69df..37443c5fda99 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -156,7 +156,7 @@ static DECLARE_DELAYED_WORK(balloon_worker, balloon_pro= cess); (GFP_HIGHUSER | __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC) =20 /* balloon_append: add the given page to the balloon. */ -static void __balloon_append(struct page *page) +static void balloon_append(struct page *page) { /* Lowmem is re-populated first, so highmem pages go at list tail. */ if (PageHighMem(page)) { @@ -169,11 +169,6 @@ static void __balloon_append(struct page *page) wake_up(&balloon_wq); } =20 -static void balloon_append(struct page *page) -{ - __balloon_append(page); -} - /* balloon_retrieve: rescue a page from the balloon, if it is not empty. */ static struct page *balloon_retrieve(bool require_lowmem) { @@ -378,7 +373,7 @@ static void xen_online_page(struct page *page, unsigned= int order) p =3D pfn_to_page(start_pfn + i); __online_page_set_limits(p); __SetPageOffline(p); - __balloon_append(p); + balloon_append(p); } mutex_unlock(&balloon_mutex); } @@ -689,7 +684,7 @@ static void __init balloon_add_region(unsigned long sta= rt_pfn, include the boot-time balloon extension, so don't subtract from it. */ __SetPageOffline(page); - __balloon_append(page); + balloon_append(page); } =20 balloon_stats.total_pages +=3D extra_pfn_end - start_pfn; --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Tue Nov 11 05:41:24 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569920598; cv=none; d=zoho.com; s=zohoarc; b=LaX3hnig5/mokbfHtX7eWTF6p6kttHb6/Al4DZe/gCIlDdkBxO+YcMWBSF9lpdJlIvOmRKQL9R+fP+74GMCfj2IxjNWbatT371okw+kExmbnbKEvV3jb4mEpdhyRVILfD352CFbdNYazgtFytMMoxBXyh3AOuDX0li5Q1Dccnzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569920598; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=eWi1iQ74krSKaGHtbBrO6Cn3ihYH8/AJwq92xZ+U2/g=; b=iZfJPuJBuBKSbi2Q5yh1oIzavfvs9TPY/6nvN5KvVVUMPzxXZa43epPR1NESmTAM1K2gxpA1/HDdRMw/iLipfYMRYWloOwc0bcu+QiQev5pw62OpnSNA05EH44k5VQIOgZU0I/gfThvAdMNK7MHHDB8knmxBUW2QEEDkCGkWuAU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569920598657606.1468155515438; Tue, 1 Oct 2019 02:03:18 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2u-0002ua-Nb; Tue, 01 Oct 2019 09:02:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2t-0002uM-Co for xen-devel@lists.xenproject.org; Tue, 01 Oct 2019 09:02:11 +0000 Received: from mx1.redhat.com (unknown [209.132.183.28]) by localhost (Halon) with ESMTPS id 2190534c-e42a-11e9-97fb-bc764e2007e4; Tue, 01 Oct 2019 09:02:01 +0000 (UTC) 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 2D1C58980F9; Tue, 1 Oct 2019 09:02:01 +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 9B09D60624; Tue, 1 Oct 2019 09:01:59 +0000 (UTC) X-Inumbo-ID: 2190534c-e42a-11e9-97fb-bc764e2007e4 From: David Hildenbrand To: linux-kernel@vger.kernel.org Date: Tue, 1 Oct 2019 11:01:51 +0200 Message-Id: <20191001090152.1770-3-david@redhat.com> In-Reply-To: <20191001090152.1770-1-david@redhat.com> References: <20191001090152.1770-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 01 Oct 2019 09:02:01 +0000 (UTC) Subject: [Xen-devel] [PATCH v1 2/3] xen/balloon: Mark pages PG_offline in balloon_append() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , David Hildenbrand , linux-mm@kvack.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Let's move the __SetPageOffline() call which all callers perform into balloon_append(). In bp_state decrease_reservation(), pages are now marked PG_offline a little later 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 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 37443c5fda99..8c245e99bb06 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -158,6 +158,8 @@ static DECLARE_DELAYED_WORK(balloon_worker, balloon_pro= cess); /* balloon_append: add the given page to the balloon. */ static void balloon_append(struct page *page) { + __SetPageOffline(page); + /* Lowmem is re-populated first, so highmem pages go at list tail. */ if (PageHighMem(page)) { list_add_tail(&page->lru, &ballooned_pages); @@ -372,7 +374,6 @@ static void xen_online_page(struct page *page, unsigned= int order) for (i =3D 0; i < size; i++) { p =3D pfn_to_page(start_pfn + i); __online_page_set_limits(p); - __SetPageOffline(p); balloon_append(p); } mutex_unlock(&balloon_mutex); @@ -466,7 +467,6 @@ static enum bp_state decrease_reservation(unsigned long= nr_pages, gfp_t gfp) state =3D BP_EAGAIN; break; } - __SetPageOffline(page); adjust_managed_page_count(page, -1); xenmem_reservation_scrub_page(page); list_add(&page->lru, &pages); @@ -648,10 +648,8 @@ void free_xenballooned_pages(int nr_pages, struct page= **pages) mutex_lock(&balloon_mutex); =20 for (i =3D 0; i < nr_pages; i++) { - if (pages[i]) { - __SetPageOffline(pages[i]); + if (pages[i]) balloon_append(pages[i]); - } } =20 balloon_stats.target_unpopulated -=3D nr_pages; @@ -669,7 +667,6 @@ static void __init balloon_add_region(unsigned long sta= rt_pfn, unsigned long pages) { unsigned long pfn, extra_pfn_end; - struct page *page; =20 /* * If the amount of usable memory has been limited (e.g., with @@ -679,12 +676,10 @@ static void __init balloon_add_region(unsigned long s= tart_pfn, extra_pfn_end =3D min(max_pfn, start_pfn + pages); =20 for (pfn =3D start_pfn; pfn < extra_pfn_end; pfn++) { - page =3D pfn_to_page(pfn); /* totalram_pages and totalhigh_pages do not include the boot-time balloon extension, so don't subtract from it. */ - __SetPageOffline(page); - balloon_append(page); + balloon_append(pfn_to_page(pfn)); } =20 balloon_stats.total_pages +=3D extra_pfn_end - start_pfn; --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Tue Nov 11 05:41:24 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569920602; cv=none; d=zoho.com; s=zohoarc; b=F7ZSD8w2FZDx8xiOHsRbapr45LnK4ysIcrH3VsRvn/bd1pGS3t1dVhCvkzFAU4Bg6+iahcSXH71AjRnJ0g8JhQF29cR3Mx4mgZyZFuPWk9pCV752Qm7iwrdz5kxgzjMrUKgHn92SuzTApYWngz0lsjOrZdMXRiK0H0Koj1WElgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569920602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0zXQwBCsXNEORs5Bfc32rYfAAaCs/ZLwQkzEqSlkVvg=; b=KQcc6Rfzg38xSUlKEyYp/m3IHDpObGMmxwJXVOKaiCdQYTY35DLd1OiMKS/MVM130NV6z2Qricd1wMObt4Y7JJFv5zcm1rX14390O4j9y9xQkuFaoM31mfq9fc74s2jUS8SdnbuoZl/Araun4Vl0lcpLoYZHJVx6QQTVDJ5nGbk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15699206029264.992346653337336; Tue, 1 Oct 2019 02:03:22 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2z-0002w5-2i; Tue, 01 Oct 2019 09:02:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFE2y-0002vr-BN for xen-devel@lists.xenproject.org; Tue, 01 Oct 2019 09:02:16 +0000 Received: from mx1.redhat.com (unknown [209.132.183.28]) by localhost (Halon) with ESMTPS id 23d89010-e42a-11e9-8628-bc764e2007e4; Tue, 01 Oct 2019 09:02:05 +0000 (UTC) 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) X-Inumbo-ID: 23d89010-e42a-11e9-8628-bc764e2007e4 From: David Hildenbrand To: linux-kernel@vger.kernel.org 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 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) Subject: [Xen-devel] [PATCH v1 3/3] xen/balloon: Clear PG_offline in balloon_retrieve() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , David Hildenbrand , linux-mm@kvack.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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_lowme= m) else balloon_stats.balloon_low--; =20 + __ClearPageOffline(page); return page; } =20 @@ -440,7 +441,6 @@ static enum bp_state increase_reservation(unsigned long= nr_pages) xenmem_reservation_va_mapping_update(1, &page, &frame_list[i]); =20 /* Relinquish the page back to the allocator. */ - __ClearPageOffline(page); free_reserved_page(page); } =20 @@ -606,7 +606,6 @@ int alloc_xenballooned_pages(int nr_pages, struct page = **pages) while (pgno < nr_pages) { page =3D balloon_retrieve(true); if (page) { - __ClearPageOffline(page); pages[pgno++] =3D page; #ifdef CONFIG_XEN_HAVE_PVMMU /* --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel