[Xenomai-git] Gilles Chanteperdrix : drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

2013-11-05 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 0c7a6eaf09ba9679fa5d9cdb4b9bebf7e4c53b33
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=0c7a6eaf09ba9679fa5d9cdb4b9bebf7e4c53b33

Author: Gilles Chanteperdrix 
Date:   Sun Oct 13 20:40:25 2013 +0200

drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

In order to pin the calling task to the same cpu as the created task, allowing
to pass the arguments to the created task on the calling task stack, without
any race condition.

---

 kernel/drivers/testing/switchtest.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index ea36ee6..6f77ee9 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -483,6 +483,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
iattr.affinity = cpumask_of_cpu(ctx->cpu);
param.rt.prio = 1;
 
+   set_cpus_allowed(current, cpumask_of_cpu(ctx->cpu));
+
err = xnthread_init(&task->ktask,
&iattr, &xnsched_class_rt, ¶m);
if (!err) {
@@ -498,7 +500,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread will preempt the current thread immediately, and
+* thread, thanks to the abovce call of set_cpus_allowed,
+* will preempt the current thread immediately, and
 * will suspend only once the arguments on stack are used.
 */
 


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

2013-10-23 Thread git repository hosting
Module: xenomai-forge
Branch: next
Commit: 0c7a6eaf09ba9679fa5d9cdb4b9bebf7e4c53b33
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=0c7a6eaf09ba9679fa5d9cdb4b9bebf7e4c53b33

Author: Gilles Chanteperdrix 
Date:   Sun Oct 13 20:40:25 2013 +0200

drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

In order to pin the calling task to the same cpu as the created task, allowing
to pass the arguments to the created task on the calling task stack, without
any race condition.

---

 kernel/drivers/testing/switchtest.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index ea36ee6..6f77ee9 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -483,6 +483,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
iattr.affinity = cpumask_of_cpu(ctx->cpu);
param.rt.prio = 1;
 
+   set_cpus_allowed(current, cpumask_of_cpu(ctx->cpu));
+
err = xnthread_init(&task->ktask,
&iattr, &xnsched_class_rt, ¶m);
if (!err) {
@@ -498,7 +500,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread will preempt the current thread immediately, and
+* thread, thanks to the abovce call of set_cpus_allowed,
+* will preempt the current thread immediately, and
 * will suspend only once the arguments on stack are used.
 */
 


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

2013-10-15 Thread git repository hosting
Module: xenomai-gch
Branch: for-forge
Commit: 08c67e725b8aee6ae711a2e6e6f361651ba0cd9b
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=08c67e725b8aee6ae711a2e6e6f361651ba0cd9b

Author: Gilles Chanteperdrix 
Date:   Sun Oct 13 20:40:25 2013 +0200

drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

In order to pin the calling task to the same cpu as the created task, allowing
to pass the arguments to the created task on the calling task stack, without
any race condition.

---

 kernel/drivers/testing/switchtest.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index ea36ee6..6f77ee9 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -483,6 +483,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
iattr.affinity = cpumask_of_cpu(ctx->cpu);
param.rt.prio = 1;
 
+   set_cpus_allowed(current, cpumask_of_cpu(ctx->cpu));
+
err = xnthread_init(&task->ktask,
&iattr, &xnsched_class_rt, ¶m);
if (!err) {
@@ -498,7 +500,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread will preempt the current thread immediately, and
+* thread, thanks to the abovce call of set_cpus_allowed,
+* will preempt the current thread immediately, and
 * will suspend only once the arguments on stack are used.
 */
 


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

2013-10-13 Thread git repository hosting
Module: xenomai-gch
Branch: for-forge
Commit: 3621fdad7d5ce79ff997b4cbf58a5ae79d8006d6
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3621fdad7d5ce79ff997b4cbf58a5ae79d8006d6

Author: Gilles Chanteperdrix 
Date:   Sun Oct 13 20:40:25 2013 +0200

drivers/switchtest: use set_cpu_allowed in rtswitch_create_ktask

In order to pin the calling task to the same cpu as the created task, allowing
to pass the arguments to the created task on the calling task stack, without
any race condition.

---

 kernel/drivers/testing/switchtest.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index ea36ee6..6f77ee9 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -483,6 +483,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
iattr.affinity = cpumask_of_cpu(ctx->cpu);
param.rt.prio = 1;
 
+   set_cpus_allowed(current, cpumask_of_cpu(ctx->cpu));
+
err = xnthread_init(&task->ktask,
&iattr, &xnsched_class_rt, ¶m);
if (!err) {
@@ -498,7 +500,8 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread will preempt the current thread immediately, and
+* thread, thanks to the abovce call of set_cpus_allowed,
+* will preempt the current thread immediately, and
 * will suspend only once the arguments on stack are used.
 */
 


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git