-
Notifications
You must be signed in to change notification settings - Fork 349
IPC4: Enable multicore LL pipelines scenario logic #6637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
791d204 to
a368536
Compare
|
@lrgirdwo @kv2019i @mwasko @marcinszkudlinski @aborisovich please review |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pblaszko good work ! I think we should also upstream an IPC4 multicore LL topology once the kernel part is ready so this will be part of E2E CI. @marc-hb @keqiaozhang fyi.
src/include/ipc4/pipeline.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart @ujfalusi - fyi driver will need a matching update, which may needed connected into core refcount/PM logic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a368536 to
b380a3e
Compare
b380a3e to
ec86096
Compare
ec86096 to
46d1084
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good! And kudos for very good git commit messages. Clear explanation why a change is made and what has been considered. This speeds up the review a lot.
src/ipc/ipc-common.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent commit message, thanks!
src/include/ipc4/pipeline.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add wrapper that translates POSIX error codes from generic ipc_process_on_core function to IPC4 status. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
When forwarding IPC to secondary core in a non-blocking mode, skip ipc response step in cmd handler on primary core. Response will be prepared by secondary core. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
Separate ipc_get_comp_by_ppl_id for ipc3 and ipc4 to allow searching for pipeline core in case of multicore scenarios. IPC4 design for multicore ll pipelines assumes all pipeline and module data is accessed only by core on which resource is allocated. Primary core use ipc_get_comp_by_ppl_id to check if the message should be forwarded to secondary core. Currently ipc_get_comp_by_ppl_id function calls ipc_comp_pipe_id which access pipeline data to retrieve pipeline id. If pipeline is allocated on secondary core, it causes a cache coherency issue. In IPC4 implementation, ipc_comp_dev.id field for pipeline represents pipeline id coming in configuration from driver. It is possible to retrieve pipeline id from component device instead of pipeline data. In IPC3 implementation, ipc_comp_dev is a unique component id coming in configuration and it is not equal to pipeline id. For IPC3 leaving implementation unchanged. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
Add core_id field into create_pipeline structure. In multicore LL pipeline scenario, all pipeline and module data should be allocated and accessed only by target core. Current IPC4 create_pipeline IPC does not contain information about target core. It is required to properly allocate pipeline. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
Pass all pipeline and module related IPC's to target core. In result, all pipeline and module data will be accessed only by the core on which this resource is allocated. Such design helps to avoid cache coherency problems without adding specific invalidate/writeback operations. This implementation of multicore scenarios is consistent with IPC3 handler. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
Cleanup duplicated use of ipc_get_comp_by_ppl_id which searches for pipeline component in components list in set pipeline state flow. Cleanup pipeline ipc component device variable names. PCM device is misleading. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
46d1084 to
aa2ceb5
Compare
|
@pblaszko can you check internal CI. Thanks ! |
|
SOFCI TEST |
Looks like some Python exception, unrelated to FW: Passed after rebuild. |
|
@pblaszko @lgirdwood can someone explain to me the concept of multi-core LL pipelines? In the traditional cAVS firmware, the LL modules are handled in a round-robin manner with the pipeline ID used as a priority. |
@plbossart In cAVS, pipelines have priorities. If priorities of two pipelines are equal, they are scheduled in the order of enabling them by driver. Scheduler does not use pipeline ID as a priority. It is driver role to start pipelines in appropriate order. Not sure how is this question related to benefits? |
|
@pblaszko WoV/ACA/heavy playback use cases do NOT make sense as LL modules, even less so when such algorithms have buffering or frame alignment requirements (e.g. 10ms for AEC or powers of 2 for time-frequency changes). The low-latency domain should be reserved for lightweight input/output related filters which can work with 1ms data (edit: and have a nearly constant activity pattern without peak MCPS requirements). It's already been the case with existing SOF that the deep-buffer stuff does not work at all once the buffering becomes large, and using multi-core solutions to work-around fundamental LL scheduling limitations is not a very good direction. I'd rather see support for DP modules.... |
@plbossart DP modules with deeper buffering are must have. We are not mixing LL and DP domains. The thing is that driver should firstly fully allocate all modules on primary core and only then allocate next modules on secondary cores (does not matter if it is LL or DP). It is power optimization. One fully loaded core consumes less power than two medium-loaded. |
|
ok, so the goal is to use multicore LL pipelines ONLY when the core0 is already loaded with too many DP+LL loads. |
While that makes sense from the power optimisation PoV, this would require dynamic core allocation or even migration. Currently pipelines are assigned to cores in the topology. So if you start just one pipeline, that is assigned to a secondary core, it will run on it, while the primary core will also be kept on for housekeeping. Also consider what happens if you first start several pipelines, which load core 0 completely, then one more pipeline that goes to core 1, then you close all pipelines on core 0. Will you want to migrate the still running pipeline from core 1 to core 0 to save power? |
@lyakh I was trying to explain the sense of multicore LL scheduler. Performance optimization is one argument and power is another. |
This PR implements SOF logic in IPC4 handler to enable multicore LL pipelines.
This is first draft or changes, that allows to use basic multicore scenarios.
Main assumptions:
This design is consistent with IPC3 handler implementation.
Future work to be done: