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

[runtime] Fix issue #376: Unify memory runtime #440

Merged
merged 5 commits into from
Jan 24, 2023

Conversation

iyzhang
Copy link
Contributor

@iyzhang iyzhang commented Jan 20, 2023

This PR fixes issue #376. Currently there is a lot of redundant code between the libOSes for the memory runtime. This changes moves the implementation of the MemoryRuntime trait for heap-allocated memory to the default implementation and leaves specially allocated memory in the relevant libOS. At this time, we only have a separate implementation for Catnip.

Summary of changes:

  • [runtime] Move implementation of heap-allocated DemiBuffers to runtime/memory/mod.rs
  • [catcollar] Eliminate runtime/memory.rs and use default implementation of MemoryRuntime trait
  • [catnap] Eliminate redundant code and use default implementation of MemoryRuntime trait
  • [catnapw] Eliminate redundant code and use default implementation of MemoryRuntime trait
  • [catpowder] Eliminate runtime/memory.rs and use default implementation of MemoryRuntime trait
  • [catmem] Eliminate redundant code.

Note: Catmem is a little awkward because it doesn't not contain a runtime, so directly implements the trait, which the demikernel layer then directly uses. Since the MemoryRuntime trait is only accessible from Catmem and not the Demikernel layer, I had to wrap some of the functions, rather than directly using the default. I will fix this architecture eventually.

Copy link
Contributor

@ppenna ppenna left a comment

Choose a reason for hiding this comment

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

Looks great.

@iyzhang could you open issues for the next work itens that mentioned in the PR's description?

@ppenna ppenna changed the title [memory] Unify memory runtime [runtime] Unify memory runtime Jan 23, 2023
@ppenna ppenna added the enhancement Enhancement Request on an Existing Feature label Jan 23, 2023
@iyzhang iyzhang force-pushed the enhancement-memory-unify-memory-runtime branch from 071f407 to 6d5d332 Compare January 24, 2023 21:14
@iyzhang iyzhang merged commit 8240cd9 into dev Jan 24, 2023
@iyzhang iyzhang deleted the enhancement-memory-unify-memory-runtime branch January 24, 2023 21:49
@iyzhang iyzhang changed the title [runtime] Unify memory runtime [runtime] Fix issue #376: Unify memory runtime Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement Request on an Existing Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants