Drivers: hv: balloon: Initialize last_post_time on startup
authorAlex Ng <alexng@messages.microsoft.com>
Sun, 6 Aug 2017 20:12:55 +0000 (13:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 16:14:43 +0000 (09:14 -0700)
When left uninitialized, this sometimes fails the following check in
post_status():

if (!time_after(now, (last_post_time + HZ))) {
return;
        }

This causes unnecessary delays in reporting memory pressure to host after
booting up.

Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_balloon.c

index 7cec4826b0115f12583773112f5fceffbef3bd42..db0e6652d7efc16b26829253668563057a5c3cf1 100644 (file)
@@ -1655,6 +1655,7 @@ static int balloon_probe(struct hv_device *dev,
        }
 
        dm_device.state = DM_INITIALIZED;
+       last_post_time = jiffies;
 
        return 0;