From: Hyman Huang <yong.huang@smartx.com> To: qemu-devel@nongnu.org Cc: "alloc.young" <alloc.young@outlook.com>, "Hyman Huang" <yong.huang@smartx.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org> Subject: [PULL 2/3] softmmu/dirtylimit: Convert free to g_free Date: Tue, 29 Aug 2023 01:19:21 +0800 [thread overview] Message-ID: <1b4e2e0a33674ccfd43e1b86fc3f882e4219c1c7.1693241678.git.yong.huang@smartx.com> (raw) In-Reply-To: <cover.1693241678.git.yong.huang@smartx.com> From: "alloc.young" <alloc.young@outlook.com> Convert free to g_free to match g_new and g_malloc functions. Fixes: cc2b33eab0 ("softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically") Fixes: baa609832e ("softmmu/dirtylimit: Implement virtual CPU throttle") Signed-off-by: alloc.young <alloc.young@outlook.com> Reviewed-by: Hyman Huang <yong.huang@smartx.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <SA1PR11MB67604ECD85AFF34BEB3072F7F5E3A@SA1PR11MB6760.namprd11.prod.outlook.com> Signed-off-by: Hyman Huang <yong.huang@smartx.com> --- softmmu/dirtylimit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c index e3ff53b8fc..fa959d7743 100644 --- a/softmmu/dirtylimit.c +++ b/softmmu/dirtylimit.c @@ -100,7 +100,7 @@ static void vcpu_dirty_rate_stat_collect(void) stat.rates[i].dirty_rate; } - free(stat.rates); + g_free(stat.rates); } static void *vcpu_dirty_rate_stat_thread(void *opaque) @@ -171,10 +171,10 @@ void vcpu_dirty_rate_stat_initialize(void) void vcpu_dirty_rate_stat_finalize(void) { - free(vcpu_dirty_rate_stat->stat.rates); + g_free(vcpu_dirty_rate_stat->stat.rates); vcpu_dirty_rate_stat->stat.rates = NULL; - free(vcpu_dirty_rate_stat); + g_free(vcpu_dirty_rate_stat); vcpu_dirty_rate_stat = NULL; } @@ -220,10 +220,10 @@ void dirtylimit_state_initialize(void) void dirtylimit_state_finalize(void) { - free(dirtylimit_state->states); + g_free(dirtylimit_state->states); dirtylimit_state->states = NULL; - free(dirtylimit_state); + g_free(dirtylimit_state); dirtylimit_state = NULL; trace_dirtylimit_state_finalize(); -- 2.39.1
WARNING: multiple messages have this Message-ID (diff)
From: Hyman Huang <yong.huang@smartx.com> To: qemu-devel@nongnu.org Cc: "alloc.young" <alloc.young@outlook.com>, "Hyman Huang" <yong.huang@smartx.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org> Subject: [PULL 2/3] softmmu/dirtylimit: Convert free to g_free Date: Tue, 29 Aug 2023 01:32:51 +0800 [thread overview] Message-ID: <1b4e2e0a33674ccfd43e1b86fc3f882e4219c1c7.1693241678.git.yong.huang@smartx.com> (raw) Message-ID: <20230828173251.ow9Qkxyohmv7d2YTrrb4TRgP7G4nhACmpPrY16NK51k@z> (raw) In-Reply-To: <cover.1693241678.git.yong.huang@smartx.com> From: "alloc.young" <alloc.young@outlook.com> Convert free to g_free to match g_new and g_malloc functions. Fixes: cc2b33eab0 ("softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically") Fixes: baa609832e ("softmmu/dirtylimit: Implement virtual CPU throttle") Signed-off-by: alloc.young <alloc.young@outlook.com> Reviewed-by: Hyman Huang <yong.huang@smartx.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <SA1PR11MB67604ECD85AFF34BEB3072F7F5E3A@SA1PR11MB6760.namprd11.prod.outlook.com> Signed-off-by: Hyman Huang <yong.huang@smartx.com> --- softmmu/dirtylimit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c index e3ff53b8fc..fa959d7743 100644 --- a/softmmu/dirtylimit.c +++ b/softmmu/dirtylimit.c @@ -100,7 +100,7 @@ static void vcpu_dirty_rate_stat_collect(void) stat.rates[i].dirty_rate; } - free(stat.rates); + g_free(stat.rates); } static void *vcpu_dirty_rate_stat_thread(void *opaque) @@ -171,10 +171,10 @@ void vcpu_dirty_rate_stat_initialize(void) void vcpu_dirty_rate_stat_finalize(void) { - free(vcpu_dirty_rate_stat->stat.rates); + g_free(vcpu_dirty_rate_stat->stat.rates); vcpu_dirty_rate_stat->stat.rates = NULL; - free(vcpu_dirty_rate_stat); + g_free(vcpu_dirty_rate_stat); vcpu_dirty_rate_stat = NULL; } @@ -220,10 +220,10 @@ void dirtylimit_state_initialize(void) void dirtylimit_state_finalize(void) { - free(dirtylimit_state->states); + g_free(dirtylimit_state->states); dirtylimit_state->states = NULL; - free(dirtylimit_state); + g_free(dirtylimit_state); dirtylimit_state = NULL; trace_dirtylimit_state_finalize(); -- 2.39.1
next prev parent reply other threads:[~2023-08-28 17:22 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-28 17:19 [PULL 0/3] Dirty page rate and dirty page limit 20230829 patches Hyman Huang 2023-08-28 17:19 ` [PULL 1/3] softmmu: Fix dirtylimit memory leak Hyman Huang 2023-08-28 17:32 ` Hyman Huang 2023-08-28 17:19 ` Hyman Huang [this message] 2023-08-28 17:32 ` [PULL 2/3] softmmu/dirtylimit: Convert free to g_free Hyman Huang 2023-08-28 17:19 ` [PULL 3/3] migration/dirtyrate: Fix precision losses and g_usleep overshoot Hyman Huang 2023-08-28 17:32 ` Hyman Huang 2023-08-28 17:32 ` [PULL 0/3] Dirty page rate and dirty page limit 20230829 patches Hyman Huang -- strict thread matches above, loose matches on Subject: below -- 2023-08-29 15:29 Hyman Huang 2023-08-29 15:29 ` [PULL 2/3] softmmu/dirtylimit: Convert free to g_free Hyman Huang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1b4e2e0a33674ccfd43e1b86fc3f882e4219c1c7.1693241678.git.yong.huang@smartx.com \ --to=yong.huang@smartx.com \ --cc=alloc.young@outlook.com \ --cc=philmd@linaro.org \ --cc=qemu-devel@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).