Skip to content
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

Remove sparse step1 #8166

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Conversation

marcinszkudlinski
Copy link
Contributor

this is a step 1 of #8106

src/ipc/ipc-helper.c Outdated Show resolved Hide resolved
@kv2019i
Copy link
Collaborator

kv2019i commented Sep 7, 2023

System PM test fails in https://sof-ci.01.org/sofpr/PR8166/build12642/devicetest/index.html and https://sof-ci.01.org/sofpr/PR8166/build12641/devicetest/index.html but occur with baseline. Main problem is the System/merge/build mandatory check now fails. @marcinszkudlinski can you check?

@marcinszkudlinski
Copy link
Contributor Author

marcinszkudlinski commented Sep 7, 2023

System PM test fails in https://sof-ci.01.org/sofpr/PR8166/build12642/devicetest/index.html and https://sof-ci.01.org/sofpr/PR8166/build12641/devicetest/index.html but occur with baseline. Main problem is the System/merge/build mandatory check now fails. @marcinszkudlinski can you check?

Problem is with IPC Probes, to be fixed.

@marcinszkudlinski
Copy link
Contributor Author

Fixed - required commit moved from "step2" to step1

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 7, 2023

Waiting for @lyakh to ack and for mandatory CI to pass.

lyakh
lyakh previously requested changes Sep 8, 2023
@@ -335,32 +301,6 @@ void buffer_attach(struct comp_buffer *buffer, struct list_item *head, int dir)
*/
void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head is now unneeded, can be removed later

src/include/sof/audio/buffer.h Show resolved Hide resolved
(_c)->__is_shared = is_shared; }
#define CORE_CHECK_STRUCT(_c) { assert(!!(_c)->__is_shared == !!is_uncached(_c)); \
assert(cpu_get_id() == (_c)->__core || (_c)->__is_shared); }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these fields are now not in struct coherent so I don't think they're needed in this header. Besides, struct comp_buffer already has bool is_shared and presumably it will be assigned close enough to where you now assign __is_shared so we can just reuse the former?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh yes, we can, yet I wanted to create a simple debug mechanism - 3 simple macros that can be used everywhere where needed, so I don't like idea of reusing any of fields from a structure

I put it in coherent.h as it is checking coherency - but there might be a better place for it, any suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd do something like

struct multicore {
    bool shared;
#if CONFIG_MULTIPLE_DEBUG
    int core:
#endif
};

somewhere in src/include/sof, maybe in src/include/sof/common.h or a new src/include/sof/multicore.h, then pass a pointer to that structure to CORE_CHECK_STRUCT() and other your checking macros, and use .shared for both debugging and run-time

This commit removes coherent.h from struct comp_buffer

As sharing status of a buffer is known at creation time, it is
enough to create a buffer in shared (not cached mem alias)
when it will be used by several cores

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]>
as buffer pointer now is not swapping between cached
and uncached aliases, there's no need to convert pointers
in notifier events

Signed-off-by: Marcin Szkudlinski <[email protected]>
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix the assert later if needed, but need to get this in CI.

/* set the buffer as a coherent object */
coherent_shared_thread(buffer, c);
/* buffer must be shared */
assert(buffer->is_shared);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this recoverable ? I assume this data is derived from topology so could a bad topology cause an assert here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not recoverable, must not happen.
If happens, a cached alias will be used for shared memory and system will crash later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but here at least you have a perfect chance to error out, don't you?

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 11, 2023

@lyakh @marcinszkudlinski Is the only blocker now the debug feature implementation? Can this be handled in separate PR (given multiple PRs are anyways planned to for this effort).

@lyakh lyakh dismissed their stale review September 11, 2023 08:07

let's improve debug design in a follow-up

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 11, 2023

Let's proceed now, and address the debug related issues later if needed (FYI @marcinszkudlinski ).

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 11, 2023

Zephyr mainlin builds are failing because of zephyrproject-rtos/zephyr#62464

@kv2019i kv2019i merged commit 94ebaa3 into thesofproject:main Sep 11, 2023
36 of 41 checks passed
@marcinszkudlinski marcinszkudlinski deleted the remove_sparse_step1 branch September 11, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants