[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 65cedd97ac82e69edac68c65253b6cf069fa56e5 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=65cedd97ac82e69edac68c65253b6cf069fa56e5 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 8c37ca60657027c2b04a2574e01ff341ecf2cd4e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8c37ca60657027c2b04a2574e01ff341ecf2cd4e Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 1b2ba3e415e365d1b1d7982638a437e99bd1e3ef URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1b2ba3e415e365d1b1d7982638a437e99bd1e3ef Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: ae75705f979128780143ca5a5017533181591b4a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ae75705f979128780143ca5a5017533181591b4a Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 94ff4cac85406a69e660ad00258807af20cd12d9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=94ff4cac85406a69e660ad00258807af20cd12d9 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 055fe208f923b27b4b0bcfd42eeb919e3bf8b762 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=055fe208f923b27b4b0bcfd42eeb919e3bf8b762 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: bbef8ef507677ca05da0e52e7fceaa096cea7981 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bbef8ef507677ca05da0e52e7fceaa096cea7981 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dd3a1ec..b90fa70 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: af3148ab868e18b0e8135600731220a21174e6f1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=af3148ab868e18b0e8135600731220a21174e6f1 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 22bb0e3..15a5048 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 0f535ef298976eb799b19e90ade2aac58c674d9b URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0f535ef298976eb799b19e90ade2aac58c674d9b Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 87737e7..36067ad 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 3241e9b..cccbbf1 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -37,6 +37,18 @@ static inline int cobalt_should_warn(void) return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 7e2231f1b04dd989929845a698ba83d3d4276313 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7e2231f1b04dd989929845a698ba83d3d4276313 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 27cad2a..83fa57c 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 7edaece2e39a16aa1e6e02d05279fb384bdaa214 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7edaece2e39a16aa1e6e02d05279fb384bdaa214 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3595583..6ff8afb 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 2d9c0b9..c1bb5a2 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: e0982ec4cacb0772e9983d4fbd81fa97afd5f430 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e0982ec4cacb0772e9983d4fbd81fa97afd5f430 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3595583..6ff8afb 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 2d9c0b9..c1bb5a2 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: b60e7481d533197c4f8efdc85bf015455e04cef6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b60e7481d533197c4f8efdc85bf015455e04cef6 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1df8e3e..07b4d15 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 11595f6a18ae909202d047c7c94ff2631776f785 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=11595f6a18ae909202d047c7c94ff2631776f785 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1df8e3e..07b4d15 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 6960e2315191701914c5a7826076b2fb028ada04 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6960e2315191701914c5a7826076b2fb028ada04 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 15c7499..5bcd7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 32874b974b30287758a8b2984cb575944a69bba8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=32874b974b30287758a8b2984cb575944a69bba8 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 15c7499..5bcd7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 642e51483ad1f8874ec2f067467f733c46487cf9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=642e51483ad1f8874ec2f067467f733c46487cf9 Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 63a0bd5..3d257c3 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 00df458bef40395141daa40e47afae508b94963c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=00df458bef40395141daa40e47afae508b94963c Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 63a0bd5..3d257c3 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: wip/dovetail Commit: 867070475384652b4e3d4a25f5ad983732a59a7e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=867070475384652b4e3d4a25f5ad983732a59a7e Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0cbe8b8..cd9f047 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: add config switch to enable lazy setsched update mode
Module: xenomai-3 Branch: next Commit: 867070475384652b4e3d4a25f5ad983732a59a7e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=867070475384652b4e3d4a25f5ad983732a59a7e Author: Philippe Gerum Date: Sun Mar 20 17:58:33 2016 +0100 lib/cobalt: add config switch to enable lazy setsched update mode --enable-lazy-setsched should be given for enabling lazy propagation of scheduling parameters upon calls to pthread_setschedparam*(), sched_setscheduler(). Defaults to off. --- configure.ac | 19 +++ lib/cobalt/internal.h | 12 lib/cobalt/sched.c|2 +- lib/cobalt/thread.c |3 ++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0cbe8b8..cd9f047 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,25 @@ if test x$workaround_condvar_pi = xy; then fi fi +dnl Lazy schedparam propagation for Cobalt (default: off) + +unset lazy_setsched_update +AC_MSG_CHECKING(whether to enable lazy scheduling parameter update) +AC_ARG_ENABLE(lazy-setsched, + AS_HELP_STRING([--enable-lazy-setsched], [Enable lazy scheduling parameter update]), + [case "$enableval" in + y | yes) lazy_setsched_update=y ;; + *) unset lazy_setsched_update ;; + esac]) +AC_MSG_RESULT(${lazy_setsched_update:-no}) +if test x$lazy_setsched_update = xy; then + if test x$rtcore_type = xcobalt; then + AC_DEFINE(CONFIG_XENO_LAZY_SETSCHED,1,[config]) + else +AC_MSG_WARN([No lazy scheduling parameter updates over Mercury - ignoring]) + fi +fi + dnl Enable shared multi-processing (default: off) use_pshared= diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index 4b8252b..1531901 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,18 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +#ifdef CONFIG_XENO_LAZY_SETSCHED +static inline int cobalt_eager_setsched(void) +{ + return cobalt_is_relaxed(); +} +#else +static inline int cobalt_eager_setsched(void) +{ + return 1; +} +#endif + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { diff --git a/lib/cobalt/sched.c b/lib/cobalt/sched.c index 87b9235..94f3323 100644 --- a/lib/cobalt/sched.c +++ b/lib/cobalt/sched.c @@ -297,7 +297,7 @@ int sched_setscheduler_ex(pid_t pid, /* See pthread_setschedparam_ex(). */ - if (cobalt_is_relaxed()) { + if (cobalt_eager_setsched()) { std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(sched_setscheduler(pid, std_policy, &std_param)); if (ret) diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c index 8b4568d..908516f 100644 --- a/lib/cobalt/thread.c +++ b/lib/cobalt/thread.c @@ -629,7 +629,8 @@ int pthread_setschedparam_ex(pthread_t thread, * threads should refrain from mixing APIs for managing * scheduling parameters, and only rely on libcobalt for this. */ - if (cobalt_is_relaxed()) { /* True if shadow not mapped yet. */ + if (cobalt_eager_setsched()) { + /* True if disabled or shadow not mapped yet. */ std_policy = cobalt_xlate_schedparam(policy, param_ex, &std_param); ret = __STD(pthread_setschedparam(thread, std_policy, &std_param)); if (ret) ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git