[Devel] [PATCH RHEL7 COMMIT] drivers/vmware: Fixup for balloon report stats to mm core

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 17 15:47:14 MSK 2022


The commit is pushed to "branch-rh7-3.10.0-1160.76.1.vz7.189.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.76.1.vz7.189.5
------>
commit b5da696faa4a42a356282eb8c23db38c099bc693
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Oct 17 15:32:50 2022 +0300

    drivers/vmware: Fixup for balloon report stats to mm core
    
    This patch eliminates about an argument with incompatible type provided
    to balloon_set_inflated_free() and
    just simplifies the patch as a whole.
    
    Fixes: efd1f2f29608 ("drivers/vmware: Balloon report stats to mm core")
    
    https://jira.sw.ru/browse/PSBM-142436
    Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
 drivers/misc/vmw_balloon.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 5bb579cde2e6..0b0b634221cd 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -917,7 +917,6 @@ static void vmballoon_inflate(struct vmballoon *b)
 
 	vmballoon_release_refused_pages(b, true);
 	vmballoon_release_refused_pages(b, false);
-	balloon_set_inflated_free(atomic64_read(&b->size) << 2);
 }
 
 /*
@@ -954,10 +953,8 @@ static void vmballoon_deflate(struct vmballoon *b)
 				error = b->ops->unlock(b, num_pages,
 						is_2m_pages, &b->target);
 				num_pages = 0;
-				if (error) {
-					balloon_set_inflated_free(atomic64_read(&b->size) << 2);
+				if (error)
 					return;
-				}
 			}
 
 			cond_resched();
@@ -966,7 +963,6 @@ static void vmballoon_deflate(struct vmballoon *b)
 		if (num_pages > 0)
 			b->ops->unlock(b, num_pages, is_2m_pages, &b->target);
 	}
-	balloon_set_inflated_free(atomic64_read(&b->size) << 2);
 }
 
 static const struct vmballoon_ops vmballoon_basic_ops = {
@@ -1059,6 +1055,8 @@ static void vmballoon_work(struct work_struct *work)
 		else if (target == 0 ||
 				b->size > target + vmballoon_page_size(true))
 			vmballoon_deflate(b);
+		balloon_set_inflated_free(b->size << 2);
+
 	}
 
 	/*


More information about the Devel mailing list