-
Notifications
You must be signed in to change notification settings - Fork 17
Multi sched read #55
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
Multi sched read #55
Conversation
c74300f
to
f8ae235
Compare
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 is looks good. Here are some minor comments as I tried to understand the code.
@@ -39,6 +39,99 @@ void test_body() | |||
}); | |||
} | |||
|
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.
I wonder if we should have some more racy tests. Where there are concurrent attempts to schedule, and hence concurrent potential wake and schedule, and sleep. We don't seem to cover those cases here.
src/rt/sched/behaviourcore.h
Outdated
{ | ||
Logging::cout() << " Previous slot is a writer or blocked reader cown " | ||
<< *new_slot << Logging::endl; | ||
<< *chain_first_slot << Logging::endl; | ||
yield(); | ||
goto fn_out; |
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.
I wonder if direct returns in this code would be clearer.
goto fn_out; | |
return {0, 0}; |
I'm also not sure I get the usage of ex_count
here. This is that all the reads in this chain have seen a READ_AVAILABLE
, so they can all decrease there execution count by 1?
src/rt/sched/behaviourcore.h
Outdated
yield(); | ||
cown->next_writer = first_body; | ||
} | ||
} | ||
|
||
// Process execution count | ||
ec[first_body_index] += ex_count; | ||
|
||
for (int i = 1; i < first_consecutive_readers_count; i++) | ||
ec[first_body_index + i] += 1; |
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.
Why is ex_count
not used here? It feels like the whole chain should get to go if the read available was seen during scheduling, but otherwise it shouldn't? Doesn't this increase the count on the chain apart from the first entry, if read available wasn't seen?
src/rt/sched/behaviourcore.h
Outdated
{ | ||
Logging::cout() << " Writer at head of queue and got the cown " | ||
<< *curr_slot << Logging::endl; | ||
<< *chain_first_slot << Logging::endl; | ||
ex_count++; | ||
yield(); | ||
} |
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.
Can ex_count
be anything other than 0 in this branch?
{ | |
Logging::cout() << " Writer at head of queue and got the cown " | |
<< *curr_slot << Logging::endl; | |
<< *chain_first_slot << Logging::endl; | |
ex_count++; | |
yield(); | |
} | |
{ | |
Logging::cout() << " Writer at head of queue and got the cown " | |
<< *chain_first_slot << Logging::endl; | |
ec[first_body_index] += 1; | |
yield(); | |
continue; | |
} |
src/rt/sched/behaviourcore.h
Outdated
|
||
// Process execution count | ||
ec[first_body_index] += ex_count; | ||
|
||
for (int i = 1; i < first_consecutive_readers_count; i++) | ||
ec[first_body_index + i] += 1; | ||
} | ||
|
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.
If we can treat ex_count
as a read chain that observed the read was available. Could we do this? Perhaps with a rename of ex_count
?
// Process execution count | |
ec[first_body_index] += ex_count; | |
for (int i = 1; i < first_consecutive_readers_count; i++) | |
ec[first_body_index + i] += 1; | |
} | |
// Process execution count | |
if (ex_count != 0) | |
{ | |
for (int i = 0; i < first_consecutive_readers_count; i++) | |
ec[first_body_index + i] += 1; | |
} | |
} | |
f8ae235
to
30f0896
Compare
@vishalgupta97 could you take a look at this? Thanks |
The changes looks good. Maybe a test case can be added to test longer changes with different combinations of reads and writes. |
No description provided.