-
Notifications
You must be signed in to change notification settings - Fork 321
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
[DNM] Direct use of cached / not-cached shared memory alias instead of coherent.h in case of buffers #8106
[DNM] Direct use of cached / not-cached shared memory alias instead of coherent.h in case of buffers #8106
Conversation
@tobonex fyi - some conflicts (will block CI). |
62ec1df
to
7cfd878
Compare
buffer_acquire and buffer_release are no longer in use remove stubs from the code Signed-off-by: Marcin Szkudlinski <[email protected]>
to verify that shared structures are used in a proper way a debug check is introduced If compiled with COHERENT_CHECK_NONSHARED_CORES flag each usage of shared structures will be verified against proper memory alias usage Signed-off-by: Marcin Szkudlinski <[email protected]>
8f30aa9
to
756705c
Compare
Ok, let's do final review going through the details better. Please ack in your approve comment which parts of the patchset you covered (if not all). Target is to merge this PR today. |
the most important is to check sparse: remove buffer_acquire / buffer_release second huge commit - other commits have already been discussed and approved |
While working on it I noted some significant changes, some may be outdated: copier_ipcgtw_process() in copier_ipcgtw.c mux_get_processing_function in mux_generic.c - buffer was not released here for some reason dai_dma_cb in dai-zephyr.c err label is hanging after deleting buffer_release here, should we just break the list audio_steram.h:1074 above audio_stream_get_source - do we want to delete comment above it now? host_legacy.c: host_common_update() - had to leave the logic here module_adapter.c : check if I refactored those correctly: module_adapter_sink_src_prepare, module_adapter_audio_stream_type_copy - leaving variables as they are, just removing sparse_cache. I want to avoid changing multiple functions for this one. generic.h module_source_info_acquire() : is removing it from coherent ok? some rebased files to check(all commits): |
What about it?
something worth to look twice.
5)also do we want to delete buffer_acquire and buffer_release definitions now?
7)host_zephyr.c: host_common_update() - had to leave the logic here
checked, is OK
|
ok, this is a problem. We need to play safer here. Can we
This approach means we have remove the performance penalty from coherent and break the work down into more manageable chunk that we can bisect and individually revert patches if needed with no impact to other modules. |
Checked (potentially less coverage in upstream CI):
|
/* NOTE: this func is called from IPC processing task and can be potentially | ||
* called before pipeline start even before buffer has been attached. In such | ||
* case do not report error but return 0 bytes available for GET_DATA and | ||
* 0 bytes free for SET_DATA. | ||
*/ | ||
buf_c = NULL; | ||
comp_warn(dev, "copier_ipcgtw_process(): no buffer found"); | ||
} |
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.
about " copier_ipcgtw_process() in copier_ipcgtw.c" I just meant this if block,
I did not substitute buf for buf_c here, as we do not need to NULL it now
@tobonex Can you add the comments inline so it's easier to discuss specific points in the context of the code in question. The comment on dai-zephyr.c sounds a bit scary, but I guess you mean with "hanging" that the error label is left to code where it really is not needed anymore, right? Code is not actually hanging... |
Yes, I'm making the comments now. And yes I meant the label is pointing at the end of block, not execution stopping. |
I'm double checking dai-zephyr right now |
} | ||
} | ||
err: |
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.
Looking at it again I think I made a mistake here, I moved the label out of the list loop. It seems the loop does not stop after an error, and just continues on to the next iteration, as error label was there to just release the buffer. Will it jump correctly if it points to end of a loop block?
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.
Module_adapter, ipc
|
||
if (!comp->is_shared) | ||
comp_make_shared(comp); | ||
} | ||
} |
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.
this looks bogus
|
||
processed_data.source_bytes = 0; | ||
|
||
/* convert format and copy to each active sink */ | ||
for (i = 0; i < num_output_buffers; i++) { | ||
struct comp_buffer __sparse_cache *sink_c; | ||
struct comp_buffer *sink_c; |
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.
should we drop "_c" from sink_c
and src_c
closing, this PR has been split to several smaller parts |
DO NOT MERGE - the PR will be spit to several PRs
All info and context: #8006