Repository: incubator-mynewt-core Updated Branches: refs/heads/1_0_0_dev [created] cdcfc86fd
MYNEWT-630: Connection supervision timeout with high throughput The issue was found to be an error in the os scheduler code. If the PendSV handler was interrupted at a certain point when we were checking to see if a context switch could occur, the code is os_sched would think no context switch was necessary. This is now fixed and the high throughput test has been running for quite some time now with no disconnect. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/b6bee9ed Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/b6bee9ed Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/b6bee9ed Branch: refs/heads/1_0_0_dev Commit: b6bee9ed12356aab34465cb03b490620ee062149 Parents: 4001f7a Author: William San Filippo <[email protected]> Authored: Fri Feb 24 20:19:42 2017 -0800 Committer: Marko Kiiskila <[email protected]> Committed: Mon Mar 6 15:47:21 2017 -0800 ---------------------------------------------------------------------- kernel/os/src/os_sched.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b6bee9ed/kernel/os/src/os_sched.c ---------------------------------------------------------------------- diff --git a/kernel/os/src/os_sched.c b/kernel/os/src/os_sched.c index 0cbe615..bb710ba 100644 --- a/kernel/os/src/os_sched.c +++ b/kernel/os/src/os_sched.c @@ -83,16 +83,11 @@ err: void os_sched_ctx_sw_hook(struct os_task *next_t) { - if (g_current_task == next_t) { - return; - } - next_t->t_ctx_sw_cnt++; g_current_task->t_run_time += g_os_time - g_os_last_ctx_sw_time; g_os_last_ctx_sw_time = g_os_time; } - /** * os sched get current task * @@ -143,9 +138,7 @@ os_sched(struct os_task *next_t) next_t = os_sched_next_task(); } - if (next_t != g_current_task) { - os_arch_ctx_sw(next_t); - } + os_arch_ctx_sw(next_t); OS_EXIT_CRITICAL(sr); }
