
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/e2e7cfbd-370f-4b32-b115-3f0a2636aeaa%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nu...@googlegroups.com.
what do you mean the term "healthy" and "unhealthy" case? can you explain more clearly?thank you!
The healthy and normal case is:
Actually, there may be nesting so that irqcount is greater than 1 at step 1. That is all still healthy if CPU 0 unwinds and releases the full irqcount so that g_cpu_irqset = 0x02, irqcount == 0 when it is finished modying the task list.
In the unhealthy case, irqcount would be > 1 at step 1 and after CPU 0 releases the irqcount, it is still greater than zero and g_cpu_irqset is still 0x03.
I sent you a test case that should illustrate the unhealthy case (if it exists). My first email on January 6 here: https://groups.google.com/forum/#!topic/nuttx/2dpzttQbVlk . The unhealthy case has not been proven to exist, but if it does it is only the unhealthy case that needs to be fixed
The problem, as you see, is that there can always be multiple CPUs holding the critical section at the time of the context switch. So it is impossible to distinguish the healthy case from the unhealthy case.
That is why I suggested that we need two different critical section locks: One general one and one to control access to the task lists, only. There are, in fact, already two such locks. But I don't think they operate independently enough to be useful right now for this purpose now.
But I think that the first step to changing the unhealthy behavior would be to change the task list locking so that we can at least distinguish the healthy case from the unhealthy case. If we can do that, then the rest of the problem is easy to solve.
Greg
i have a little puzzle about the healthy mode:2. CPU 0 starts a task on CPU 1. The task on CPU 1 needs the critical section (g_cpu_irqset = 0x03. This is completely normal).it seems the this cant happened because of the global lock owned by cpu0 and would released in by step3, but it is busy now because of taken by cpu0.so cpu1 would spin till step 3.
The healthy and normal case is:
- CPU 0 takes critical section so that it can change the task lists. (g_cpu_irqset = 0x01, irqcount == 1)
- CPU 0 starts a task on CPU 1.
- The task on CPU 1 needs the critical section (g_cpu_irqset = 0x03. This is completely normal).
- CPU 0 releases the critical section (g_cpu_irqset = 0x02, irqcount == 0);
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/368000da-edb0-20fd-5910-0d4f14b113f7%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/CAAhLDMauVHg6kEPDPFcxtw1B%2BuTcdikDEBfH%3DeNyFfLPz14B8g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/3493df68-c752-c5fa-8867-e3873636ec90%40gmail.com.
We prefer test code which can run on nsh.
I haven't looked at this carefully, but I think this could be implemented as two builtin tasks;
This, of course, would have to violate the POSIX interface; applications don't get to have critical sections or to call nxsem_* interfaces. But you can violate those interfaces for the purposes of testing.
Greg
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/e966f44a-90ef-7879-96fb-0745962d95bb%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/CAAhLDMZ26e3B17indXLqSUNxjQMOoEDzbTTNG94Qo%2BE-6cgXyg%40mail.gmail.com.
By the way, did you try ostest on your environment (dual Cortex-A7)?There are many tests including semaphore.Masayuki
2020年1月16日(木) 15:51 Masayuki Ishikawa <masayuki...@gmail.com>:
I'm a bit confused with the code you added in nx_bringup.c.You also added while (abc); in both threads (perhaps) to debug kernel resources?And what is your intension for this test?I think this test is to check if two tasks are synchronized with one semaphoreI've just added this test case (slightly modified not to use while (1) for example) as csection_test.c under ostestand the test seems works without any problems so far on Sony Spresense in dual core mode.Masayuki
2020年1月16日(木) 14:49 tugouxp tugouxp <tug...@gmail.com>:
On Thu, Jan 16, 2020 at 11:32 AM Gregory Nutt <spud...@gmail.com> wrote:
--
We prefer test code which can run on nsh.I haven't looked at this carefully, but I think this could be implemented as two builtin tasks;
- The first runs and blocks on nxsem_wait()
- The second calls nxsem_post() to demonstrate the problem.
This, of course, would have to violate the POSIX interface; applications don't get to have critical sections or to call nxsem_* interfaces. But you can violate those interfaces for the purposes of testing.
Greg
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/e966f44a-90ef-7879-96fb-0745962d95bb%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nu...@googlegroups.com.
By the way, did you try ostest on your environment (dual Cortex-A7)?There are many tests including semaphore.Masayuki
2020年1月16日(木) 15:51 Masayuki Ishikawa <masayuki...@gmail.com>:
I'm a bit confused with the code you added in nx_bringup.c.You also added while (abc); in both threads (perhaps) to debug kernel resources?And what is your intension for this test?I think this test is to check if two tasks are synchronized with one semaphoreI've just added this test case (slightly modified not to use while (1) for example) as csection_test.c under ostestand the test seems works without any problems so far on Sony Spresense in dual core mode.Masayuki
2020年1月16日(木) 14:49 tugouxp tugouxp <tug...@gmail.com>:
On Thu, Jan 16, 2020 at 11:32 AM Gregory Nutt <spud...@gmail.com> wrote:
--
We prefer test code which can run on nsh.I haven't looked at this carefully, but I think this could be implemented as two builtin tasks;
- The first runs and blocks on nxsem_wait()
- The second calls nxsem_post() to demonstrate the problem.
This, of course, would have to violate the POSIX interface; applications don't get to have critical sections or to call nxsem_* interfaces. But you can violate those interfaces for the purposes of testing.
Greg
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/e966f44a-90ef-7879-96fb-0745962d95bb%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/06aaebf4-127f-4dc2-bc0c-910b1925b868%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/367c6a26-2873-4047-92de-b6f160b7f41d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/06aaebf4-127f-4dc2-bc0c-910b1925b868%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/a952b641-9be0-47b5-97ec-a362dc926c92%40googlegroups.com.
Xiang
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/367c6a26-2873-4047-92de-b6f160b7f41d%40googlegroups.com.
i need time to read the doc detail to understand the new design spirits. thanks again for your dedication.