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

Interrupt latency benchmark #44

Merged
merged 3 commits into from
Apr 14, 2023
Merged

Interrupt latency benchmark #44

merged 3 commits into from
Apr 14, 2023

Conversation

rmn30
Copy link
Contributor

@rmn30 rmn30 commented Mar 29, 2023

No description provided.

@rmn30 rmn30 force-pushed the interrupt_latency branch 3 times, most recently from b2963fc to 6b73198 Compare March 29, 2023 17:24
@@ -413,19 +413,19 @@ int __cheri_compartment("sched")
}
return typed_op<Event>(evt, [&](Event &event) {
return event.bits_wait(
retBits, bitsToWait, clearOnExit, waitAll, timeout);
retBits, bitsToWait, flags & EventWaitClearOnExit, flags & EventWaitAll, timeout);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to wrap this in the same kind of template that I did for PAL features in snmalloc. Something like:

template<EventWaitFlags Desired>
bool has_event_flag(int eventFlags)
{
    return eventFlags & int(Desired);
}

I am always somewhat nervous of raw & for checking bitfields because you're relying on the implicit conversion to bool, which can happen in a different place if you don't put enough brackets around the expression. Putting it in a separate function forces it to happen at the evaluation of the return and better expresses intentionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better now?

sdk/core/scheduler/main.cc Outdated Show resolved Hide resolved
sdk/include/event.h Outdated Show resolved Hide resolved
@rmn30 rmn30 marked this pull request as ready for review March 30, 2023 09:15
@@ -98,3 +121,24 @@ int __cheri_compartment("sched")
event_delete(struct SObjStruct *heapCapability, void *evt);

__END_DECLS

#ifdef __cplusplus
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure these should go in the public header: I don't see them as being useful for anything other than the scheduler (a helper for constructing the flags would be).

@rmn30 rmn30 marked this pull request as draft April 4, 2023 13:44
@rmn30
Copy link
Contributor Author

rmn30 commented Apr 4, 2023

Marking as draft due to unresolved issues especially around yield_interrupt_enabled.

@rmn30
Copy link
Contributor Author

rmn30 commented Apr 12, 2023

After some consideration have decided that we don't need the NoYield flag: the path is already very close to a real interrupt except things happen in a slightly different order. We still need to keep interrupts disabled in the scheduler.

@rmn30 rmn30 marked this pull request as ready for review April 14, 2023 09:51
This can mess up the interrupt latency benchmark because an interrupt
can fire in call to event_wait_bits even though we called from an
interrupt disabled context.  We need to evaluate whether we really
need to enable intererupts here.
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.

None yet

3 participants