Module: xenomai-3
Branch: wip/rtnet-fixes
Commit: ac098c017c392d105d3d67ff497077ad5db1b45b
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ac098c017c392d105d3d67ff497077ad5db1b45b

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jan 15 14:45:22 2018 +0100

cobalt/rtdm: fix semaphore wait mode for fd_cleanup thread

This thread must wait for work in interruptible mode, does not wait
for a device event. This fixes the bad process time accounting which
otherwise would converge to 1.00 for an idle system when the Cobalt
core is enabled.

---

 kernel/cobalt/rtdm/fd.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/rtdm/fd.c b/kernel/cobalt/rtdm/fd.c
index 7daf532..b4d3920 100644
--- a/kernel/cobalt/rtdm/fd.c
+++ b/kernel/cobalt/rtdm/fd.c
@@ -245,11 +245,10 @@ static int fd_cleanup_thread(void *data)
                set_cpus_allowed_ptr(current, cpu_online_mask);
 
                do {
-                       err = down_killable(&rtdm_fd_cleanup_sem);
-               } while (err && !kthread_should_stop());
-
-               if (kthread_should_stop())
-                       break;
+                       err = down_interruptible(&rtdm_fd_cleanup_sem);
+                       if (kthread_should_stop())
+                               return 0;
+               } while (err);
 
                xnlock_get_irqsave(&fdtree_lock, s);
                fd = list_first_entry(&rtdm_fd_cleanup_queue,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to