From nobody Tue Dec 16 16:19:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741988337; cv=none; d=zohomail.com; s=zohoarc; b=JCTYwxNm8mDkpB8r+wqcbiPArDPwJ+KmuluyrWi7f72ji9dYp0e+jN3gGi/E1DLfsUwrTdDP4zWzSXKheGB+TPF+T/w3H88fthEvywVkLJ12zyBn+WxwVFtKAWbP8fR1/tuaoaOBTI244padTXxsy6LR2vfms5IS+5u4e14C6iI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741988337; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3RXL+coJsdtD8dzVN3au7Q2NbBlOYxUwoHTJ/KoQPU4=; b=gIME2ncrwVkYz4PlgqLOW524hWiyEpi85BAC7Z1y459+iMquFhQLQWHXiW7zbrCr0533Fqo+Gy/oKNrUM+t2ZxzUmiHHs7I975OS8Xuy6aQglswVAK/n1Kd21u2FN/xulwBuoLZ3ABDlkJopv21uPiIW9tga17ghNaMW9GOfai4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1741988337139438.34429485069313; Fri, 14 Mar 2025 14:38:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.915465.1320999 (Exim 4.92) (envelope-from ) id 1ttCjm-0008Nc-DH; Fri, 14 Mar 2025 21:38:38 +0000 Received: by outflank-mailman (output) from mailman id 915465.1320999; Fri, 14 Mar 2025 21:38:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ttCjm-0008NT-AD; Fri, 14 Mar 2025 21:38:38 +0000 Received: by outflank-mailman (input) for mailman id 915465; Fri, 14 Mar 2025 21:38:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ttCjl-000827-06 for xen-devel@lists.xenproject.org; Fri, 14 Mar 2025 21:38:37 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id af13fe1c-011c-11f0-9ab9-95dc52dad729; Fri, 14 Mar 2025 22:38:36 +0100 (CET) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-0r6UKT9IMtuF-Il_bN2UWQ-1; Fri, 14 Mar 2025 17:38:30 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8BDC195608D; Fri, 14 Mar 2025 21:38:22 +0000 (UTC) Received: from h1.redhat.com (unknown [10.22.80.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6352D1944E42; Fri, 14 Mar 2025 21:38:17 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: af13fe1c-011c-11f0-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741988315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3RXL+coJsdtD8dzVN3au7Q2NbBlOYxUwoHTJ/KoQPU4=; b=DI/0F6cdNKPnPLBqukHBXVa5rFs6vXRJriXpiLIanfhiv9rIRXWELF9e9oqlnZHXYFXowF pTIYWg0QnhP76BrUyTurfg7Fnco06zBf9/o5noftNo0VG0jtW/5OfxZ+4xxpXP7iYlkxjg puSmDYjwuteCj28N5eULfMOs7nw9tU4= X-MC-Unique: 0r6UKT9IMtuF-Il_bN2UWQ-1 X-Mimecast-MFC-AGG-ID: 0r6UKT9IMtuF-Il_bN2UWQ_1741988303 From: Nico Pache To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux.dev Cc: alexander.atanasov@virtuozzo.com, muchun.song@linux.dev, roman.gushchin@linux.dev, mhocko@kernel.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, jgross@suse.com, sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, akpm@linux-foundation.org, mst@redhat.com, david@redhat.com, yosry.ahmed@linux.dev, hannes@cmpxchg.org, nphamcs@gmail.com, chengming.zhou@linux.dev, kanchana.p.sridhar@intel.com, llong@redhat.com, shakeel.butt@linux.dev Subject: [PATCH v2 2/4] balloon_compaction: update the NR_BALLOON_PAGES state Date: Fri, 14 Mar 2025 15:37:55 -0600 Message-ID: <20250314213757.244258-3-npache@redhat.com> In-Reply-To: <20250314213757.244258-1-npache@redhat.com> References: <20250314213757.244258-1-npache@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1741988339043019100 Content-Type: text/plain; charset="utf-8" Update the NR_BALLOON_PAGES counter when pages are added or removed using the balloon compaction interface. The virtio, Vmware, and pseries-cmm balloon drivers utilize the balloon_compaction interface to allocate and free balloon pages. Other balloon drivers will have to maintain this counter manually. Signed-off-by: Nico Pache --- mm/balloon_compaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c index 6597ebea8ae2..d3e00731e262 100644 --- a/mm/balloon_compaction.c +++ b/mm/balloon_compaction.c @@ -24,6 +24,7 @@ static void balloon_page_enqueue_one(struct balloon_dev_i= nfo *b_dev_info, balloon_page_insert(b_dev_info, page); unlock_page(page); __count_vm_event(BALLOON_INFLATE); + inc_node_page_state(page, NR_BALLOON_PAGES); } =20 /** @@ -103,6 +104,7 @@ size_t balloon_page_list_dequeue(struct balloon_dev_inf= o *b_dev_info, __count_vm_event(BALLOON_DEFLATE); list_add(&page->lru, pages); unlock_page(page); + dec_node_page_state(page, NR_BALLOON_PAGES); n_pages++; } spin_unlock_irqrestore(&b_dev_info->pages_lock, flags); --=20 2.48.1