All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>
Subject: [Xen-devel] [PATCH 2/2] xen/sched: fix freeing per-vcpu data in sched_move_domain()
Date: Wed, 25 Sep 2019 09:05:03 +0200	[thread overview]
Message-ID: <20190925070503.13850-3-jgross@suse.com> (raw)
In-Reply-To: <20190925070503.13850-1-jgross@suse.com>

In case of an allocation error of per-vcpu data in sched_move_domain()
the already allocated data is freed just using xfree(). This is wrong
as some schedulers need to do additional operations (e.g. the arinc653
scheduler needs to remove the vcpu-data from a list).

So instead xfree() make use of the sched_free_vdata() hook.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/schedule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 13b5ffc7cf..13c17fe944 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -386,7 +386,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         if ( vcpu_priv[v->vcpu_id] == NULL )
         {
             for_each_vcpu ( d, v )
-                xfree(vcpu_priv[v->vcpu_id]);
+                sched_free_vdata(c->sched, vcpu_priv[v->vcpu_id]);
             xfree(vcpu_priv);
             sched_free_domdata(c->sched, domdata);
             return -ENOMEM;
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-09-25  7:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25  7:05 [Xen-devel] [PATCH 0/2] xen/sched: fix freeing of per-vcpu data Juergen Gross
2019-09-25  7:05 ` [Xen-devel] [PATCH 1/2] xen/sched: fix locking in a653sched_free_vdata() Juergen Gross
2019-09-25  8:41   ` Jan Beulich
2019-09-25 10:59   ` Dario Faggioli
2019-09-27  7:23     ` Jürgen Groß
2019-09-27  8:20       ` Jan Beulich
2019-09-27  8:27         ` Jürgen Groß
2019-09-25  7:05 ` Juergen Gross [this message]
2019-09-25  8:41   ` [Xen-devel] [PATCH 2/2] xen/sched: fix freeing per-vcpu data in sched_move_domain() Jan Beulich
2019-09-25 10:58   ` Dario Faggioli

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=20190925070503.13850-3-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.