Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/schedule/ll_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,11 @@ static void schedule_ll_domain_clear(struct ll_schedule_data *sch,
if (count == 1) {
sch->domain->registered[cpu_get_id()] = false;

count = atomic_sub(&sch->domain->num_clients, 1);
if (count == 1)
domain_clear(sch->domain);
if (atomic_read(&sch->domain->num_clients)) {
count = atomic_sub(&sch->domain->num_clients, 1);
Comment on lines +334 to +335
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if num_clients changes here between reading and subtracting. @lgirdwood @plbossart what do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if num_clients changes here between reading and subtracting. @lgirdwood @plbossart what do you think ?

We hold the domain->lock during these checks so that should not happen.

BTW, we are kind of mess in this client/task management, I am working on refining them, please see the PR here: #4089

Copy link
Member

Choose a reason for hiding this comment

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

ok, this is fine with the locks held.

if (count == 1)
domain_clear(sch->domain);
}
}

tr_info(&ll_tr, "num_tasks %d total_num_tasks %d",
Expand Down