Hi list,
I am working on a port of an Ethernet-based fieldbus stack to TUDOS. The stack is a Linux kernel module so I am utilizing DDE as a wrapper for this. Things seem to work like this: the module creates a kernel thread which does the network polling in an endless loop. The loop basically looks like this: while (1) receive_data() process_data() send_data() schedule_func()
Here, schedule_func() does the following: set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1);
Which I interpret as something like wait for 10ms (assume HZ==100) or an event to occur and then restart the loop. schedule_timeout() creates a new timer with the specified timeout and calls plain schedule(). Ok, this works quite good up to an arbitrary point where the complete system stops working. Sometimes, the system runs 2min, sometimes 1h and sometimes 3h, so it varies a lot. After the stuck occurs, using jdb, I see the kernel_thread waiting for a message to be woken up. On the other hand, the timer_thread which has to throw this messages is in idle state. I am still a L4 beginner, especially in debugging its subsystems. However, for me that looks like we lost a timer event somewhere. I replaced schedule_timeout() with msleep(10) which omits the timer stuff and that works for me here for hours without any stuck. Before further tracking down this issue I want to make sure that you guys don't have any patch pending that fixes that problem, have u?
Best regards,
Andre
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
thanks a lot for the bug report. We actually found 2 bugs in DDEKit through it.
The first one concerning concurrency issues in memory management should already be available through the public SVN. The second one fixes the timer implementation to not miss any notifications and lets your test case run on my test machine. Patch attached, should be in public SVN soon as well.
Cheers, Bjoern
Hi,
thanks for pointing that out. I've been running my timer tests for over 20h and all looks brilliant.
Best regards,
Andre
Björn Döbel wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
thanks a lot for the bug report. We actually found 2 bugs in DDEKit through it.
The first one concerning concurrency issues in memory management should already be available through the public SVN. The second one fixes the timer implementation to not miss any notifications and lets your test case run on my test machine. Patch attached, should be in public SVN soon as well.
Cheers, Bjoern -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknKWrIACgkQP5ijxgQLUNlPNACdFn53qKUxlFuzMI9t+8+XXLgb UFIAn1AF1kY1mmNSbZe1Vra5tCZ94HNH =VJf1 -----END PGP SIGNATURE-----
l4-hackers@os.inf.tu-dresden.de