libxl: Restore scheduling parameters after migrate in best-effort fashion
PATCH 1/1 libxl: Restore scheduling parameters after migrate in best-effort fashion
Commit 3b4adba ("tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected by libxl_retrieve_domain_configuration(), in order to report that information in xl list -l.
Unfortunately, libxl_retrieve_domain_configuration() is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:
libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3
Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler, libxl_domain_sched_params_set() will fail if there's a different scheduler. However, if you pass LIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.
In domcreate_stream_done(), before calling libxl__build_post(), set the scheduler to LIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Dario Faggioli <[email protected]>
CC: Juergen Gross <[email protected]>
--- tools/libxl/libxl_create.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/libxl/libxl_create.c +9 -0
@@ -1237,6 +1237,15 @@ static void domcreate_stream_done(libxl__egc *egc, ret =ERROR_INVAL ; goto out; } + +/* +* The scheduler on the sending domain may be different than the +* scheduler running here. Setting the scheduler to UNKNOWN will +* cause the code to take to take whatever parameters are +* available in that scheduler, while discarding the rest. +*/ + info->sched_params.sched =LIBXL_SCHEDULER_UNKNOWN ; + ret =libxl__build_post (gc, domid, info, state, vments, localents);if (ret) goto out;
Signature · 7 lines
2.19.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 26 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.
Quoted 6 lines
In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>
Sorry, forgot to mention this should be considered 'RFC' until I can arrange to test it.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 26 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.
Quoted 6 lines
In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>
I've tested this with save/restore now, and it works fine (including changing the weight of the VM from default and having the updated weight show up in the other scheduler on restore).
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 26 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.
Quoted 6 lines
In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Dario Faggioli
Reviewed-byQuoted 40 lines · Juergen Gross
Quoted 39 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by
the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to
handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the
parameters of all schedulers, as well as a parameter specifying which
scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use
the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best- effort
basis.
Quoted 4 lines
Quoted 1 line
Signed-off-by George Dunlap <[email protected]>Acked-by Juergen Gross <[email protected]>
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Software Engineer @ SUSE https://www.suse.com/
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 40 lines · Juergen Gross
Quoted 39 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by
the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to
handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the
parameters of all schedulers, as well as a parameter specifying which
scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use
the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best- effort
basis.
Quoted 4 lines
Quoted 1 line
Signed-off-by George Dunlap <[email protected]>Acked-by Juergen Gross <[email protected]>
Wei, Ian, ping?
We've reverted Credit2 as default scheduler, not because of a Credit2 own issue, but because of the bug fixed by this patch.
I think it would be both fair and appropriate to re-instate it (i.e., Credit2 as default), as soon as possible.
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Software Engineer @ SUSE https://www.suse.com/
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 49 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Dario Faggioli <[email protected]>
CC: Juergen Gross <[email protected]>--- tools/libxl/libxl_create.c | 9 +++++++++ 1 file changed, 9 insertions(+)tools/libxl/libxl_create.c +0
-0@@ -1237,6 +1237,15 @@ static void domcreate_stream_done(libxl__egc *egc, ret =ERROR_INVAL ;
tools/libxl/libxl_create.c static void domcreate_stream_done(libxl__egc *egc, · line 1247
Quoted 10 lines
tools/libxl/libxl_create.c +8
-0goto out; } + +/* +* The scheduler on the sending domain may be different than the +* scheduler running here. Setting the scheduler to UNKNOWN will +* cause the code to take to take whatever parameters are +* available in that scheduler, while discarding the rest. +*/ + info->sched_params.sched =LIBXL_SCHEDULER_UNKNOWN ;
But this function is called by normal domain creation as well. What if libxl user does set the parameter?
Wei.
Quoted 7 lines
tools/libxl/libxl_create.c +1
-0+ ret =libxl__build_post (gc, domid, info, state, vments, localents);if (ret) goto out;Signature · 1 line
2.19.0
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 55 lines · Wei Liu
Quoted 54 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Dario Faggioli <[email protected]>
CC: Juergen Gross <[email protected]>--- tools/libxl/libxl_create.c | 9 +++++++++ 1 file changed, 9 insertions(+)tools/libxl/libxl_create.c +3
-0@@ -1237,6 +1237,15 @@ static void domcreate_stream_done(libxl__egc *egc, ret =ERROR_INVAL ; goto out; } + +/* +* The scheduler on the sending domain may be different than the
Quoted 8 lines
tools/libxl/libxl_create.c static void domcreate_stream_done(libxl__egc *egc, · line 1247
Quoted 5 lines
tools/libxl/libxl_create.c +5
-0+* scheduler running here. Setting the scheduler to UNKNOWN will +* cause the code to take to take whatever parameters are +* available in that scheduler, while discarding the rest. +*/ + info->sched_params.sched =LIBXL_SCHEDULER_UNKNOWN ;But this function is called by normal domain creation as well. What if libxl user does set the parameter?
Is it? I thought the stream meant it was only called when doing migrate / resume.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 65 lines · George Dunlap
Quoted 55 lines · Wei Liu
Quoted 54 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Dario Faggioli <[email protected]>
CC: Juergen Gross <[email protected]>--- tools/libxl/libxl_create.c | 9 +++++++++ 1 file changed, 9 insertions(+)tools/libxl/libxl_create.c +3
-0@@ -1237,6 +1237,15 @@ static void domcreate_stream_done(libxl__egc *egc, ret =ERROR_INVAL ; goto out; } + +/* +* The scheduler on the sending domain may be different than the Quoted 8 lines
tools/libxl/libxl_create.c static void domcreate_stream_done(libxl__egc *egc, · line 1247
Quoted 5 lines
tools/libxl/libxl_create.c +5
-0+* scheduler running here. Setting the scheduler to UNKNOWN will +* cause the code to take to take whatever parameters are +* available in that scheduler, while discarding the rest. +*/ + info->sched_params.sched =LIBXL_SCHEDULER_UNKNOWN ;But this function is called by normal domain creation as well. What if libxl user does set the parameter?
Quoted 2 lines
Is it? I thought the
streammeant it was only called when doing migrate / resume.
Yes, you're right. Feel free to add my ack.
Wei.
Quoted 2 lines
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 66 lines · Wei Liu
Quoted 65 lines · George Dunlap
Quoted 63 lines · Wei Liu
Quoted 49 lines · George Dunlap
Commit 3b4adba ("
tools/libxl: include scheduler parameters in the output of xl list -l") added scheduling parameters to the set of information collected bylibxl_retrieve_domain_configuration(), in order to report that information inxl list -l.Unfortunately,
libxl_retrieve_domain_configuration()is also called by the migration / save code, and the results passed to the restore / receive code. This meant scheduler parameters were inadvertently added to the migration stream, without proper consideration for how to handle corner cases. The result was that if migrating from a host running one scheduler to a host running a different scheduler, the migration would fail with an error like the following:libxl: error: libxl_sched.c:232:sched_credit_domain_set: Domain 1:Getting domain sched credit: Invalid argument
libxl: error: libxl_create.c:1275:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3Luckily there's a fairly straightforward way to set parameters in a "best-effort" fashion. libxl provides a single struct containing the parameters of all schedulers, as well as a parameter specifying which scheduler. Parameters not used by a given scheduler are ignored. Additionally, the struct contains a parameter to specify the scheduler. If you specify a specific scheduler,
libxl_domain_sched_params_set()will fail if there's a different scheduler. However, if you passLIBXL_SCHEDULER_UNKNOWN, it will use the value of the current scheduler for that domain.In
domcreate_stream_done(), before callinglibxl__build_post(), set the scheduler toLIBXL_SCHEDULER_UNKNOWN. This will propagate scheduler parameters from the previous instantiation on a best-effort basis.Signed-off-by George Dunlap <[email protected]>---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Dario Faggioli <[email protected]>
CC: Juergen Gross <[email protected]>--- tools/libxl/libxl_create.c | 9 +++++++++ 1 file changed, 9 insertions(+)tools/libxl/libxl_create.c +0
-0@@ -1237,6 +1237,15 @@ static void domcreate_stream_done(libxl__egc *egc, ret =ERROR_INVAL ;tools/libxl/libxl_create.c static void domcreate_stream_done(libxl__egc *egc, · line 1247
Quoted 10 lines
tools/libxl/libxl_create.c +8
-0goto out; } + +/* +* The scheduler on the sending domain may be different than the +* scheduler running here. Setting the scheduler to UNKNOWN will +* cause the code to take to take whatever parameters are +* available in that scheduler, while discarding the rest. +*/ + info->sched_params.sched =LIBXL_SCHEDULER_UNKNOWN ;But this function is called by normal domain creation as well. What if libxl user does set the parameter?
Quoted 4 lines
Quoted 2 lines
Is it? I thought the
streammeant it was only called when doing migrate / resume.Yes, you're right. Feel free to add my ack.
Great, thanks. I'll re-push the credit2 default patch after this gets pushed to master.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel