Repository navigation
Conversation
|
@keyonjie im having a hard time imagining a scenario where this would work properly. If a new task instance arrives before the previous instance completes cleanly, we have lost all the context of the previous task, so keeping a pending count to re-schedule this task will only lead to errors in my opinion. Also, have you verified this is still an actual issue? could you please share some logs to show the issue? |
|
|
@keyonjie lets have some logs of the issue before we commit any speculative changes. |
If your PR helps with any Issue, please name it in the PR description, so that that Issue's problem statement help people understand what problem end users will run into without your PR. |
|
this PR helps for #743 |
de1c426 to
e44f032
Compare
@lgirdwood I captured logs like "task 0xXXX already WIP, schedule it later..." from time to time(e.g. happens every 100s~200s playback) where we will drop a schedule copy, then Xrun happens. I captured this weeks back with messed debugging code changes, I didn't attach the logs here as it may be confusing. Let me try to re-do that later and attach logs. |
libinyang
left a comment
There was a problem hiding this comment.
I'm not similar with schedule. Just give some comments purely based on the code.
There was a problem hiding this comment.
why remove check state? Even in TASK_STATE_FREE, TASK_STATE_CANEL, TAKS_STATE_INIT and so on without our any cnt > 0?
There was a problem hiding this comment.
The pending_cnt may be wrong now.
Let's image if pending_cnt is 2, and the state is PENDING. schedule_task() will be called. In _schedule_task(), the pending_cnt will be added again. But in this case, the cnt should not be added, right?
There was a problem hiding this comment.
So it should not be named pipeline_schedule_copy_idle()?
And this simple code may impact a lot. Please do a stress test, especially with encoding/decoding and other tasks together. I'm not confident on the side effect of this code.
When one instance of a task is queued(queued, pending, running, or preempted), it is possible that another instance of this same task scheduling reqire will come before the previous one is completed. In today's design, this second instance may be dropped(e.g. for pipeline_copy() task) and unexpected error will happen. Here, we add a pending_cnt for the task, accumulate it when needed, and schedule it when the previous one is finished. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
|
we are seeing error logs in sof-logger without the fix: |
|
@keyonjie can you confirm the intention here is to allow a task to be scheduled twice ? Wouldn't this mean that it was being rescheduled before it was finished ? |
The intention here is to allow a task(e.g. schedule_copy for Pipeline 1) can be add to list at the second time(before the first time done) and be scheduled later, it(the 2nd one) won't be rescheduled before the 1st one was finished. Without this, the 2nd task might be dropped, or impact the 1st instance which is under scheduling. |
|
@keyonjie ok, but my question is why is Pipe1 being rescheduled before it's completed ?This implies there is not enough free cycles to complete the pipe1 processing in this case ? |
@lgirdwood according to my test, some other cases such as pipeline_schedule_idle(not scheduled at once) might also hit to this. |
@lgirdwood I only found it from idle scheduling till now and no bandwidth to try it more now, I am fine to close this PR and waiting for scheduler updates if it will fix this issue. |
|
@keyonjie ok, lets close now and keep the issue as under investigation |
|
OK, closing it now. |
This series is [4/5] of fixes of #800.
When one instance of a task is queued(queued, pending, running, or
preempted), it is possible that another instance of this same task
scheduling require will come before the previous one is completed. In
today's design, this second instance may be dropped(e.g. for
pipeline_copy() task) and unexpected error will happen.
Here, we add a pending_cnt for the task, accumulate it when needed, and
schedule it when the previous one is finished.
Signed-off-by: Keyon Jie yang.jie@linux.intel.com