-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
7cb4198 to
20cb191
Compare
modules/axfs/src/root.rs
Outdated
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 combine CURRENT_DIR_PATH and CURRENT_DIR into one variable?
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.
They should always be modified at the same time, and not doing so would be a semantic error. Using a single variable facilitates management and avoids errors when writing code.
Cargo.toml
Outdated
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 we publish the axns to crates.io? Maybe this crate doesn't need to modified frequently?
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.
Well it's fine, but since it is an ArceOS related module, I was worried about the owner and permissions so I didn’t do it.
|
I would also like to discuss the design of
I am currently inclined to a way that requiring users to register the currently active namespace in a similar way to how Rust async runtime libraries manage active runtime (see Tokio/compio). If there is no active namespace, accessing resources will panic. For example, in our let _guard = axns::set_current_ns(xxx);And the current namespace get cleared when the guard dropped. But this also have issues:
This is a balance between cost and convenience. |
Since the addressing of namespace is for tasks, namespace switching can be done with task switching. But this introduces a new problem. Namespace is managed by |
We temporarily call the switching function for Task Extension as
Therefore, the implementation of this mechanism will have certain significance. |
In what cases is it necessary to use |
Compared to considering the performance of namespace access, I think we should pay more attention to the scenarios where the namespace mechanism is used. Currently, there are not many resources using namespaces. Is it necessary to expand the usage scenarios of namespaces and make more content become resources of namespaces? Because an important goal of namespace is to use the same set of management logic (code) to control resources from different sources, so as to achieve sharing between Unikernel and Monolithic kernel. However, current development does not seem to pay special attention to this. One evidence is that we do not define resources in a way that is convenient for namespace management. |
This is mainly considered to implement |
OK, you may have inspired my craziest idea. We can even use this system to manage the address space! This is effectively the same as how we define a shareable resource now: globally unique for a unikernel, task-specific for a monolithic kernel, and shareable between tasks. And with the switching mechanism, we can move the code for page table switching out from The only problem with this design is that it goes out of scope 😂 |
|
Closing this for now. |
Description
This PR replaces the
axnsmodule with https://github.com/starry-OS/axns crate to enhance its functionality and resolve the memory leaking issue.The second commit merged
CURRENT_DIR_PATHinaxfsintoCURRENT_DIRto allow easier management.Issues
FlattenObjectsdoes not implCloneand we can not write acopy_innerlike before. Maybe we'd better improveflatten_objects.ctor_bareanymore?axfsrefactor is on its way at https://github.com/Starry-OS/axfs-ng so I don't change it too much.