Skip to content

ramfs as an example/benchmark #369

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

Open
nbdd0121 opened this issue Jun 9, 2021 · 13 comments
Open

ramfs as an example/benchmark #369

nbdd0121 opened this issue Jun 9, 2021 · 13 comments
Labels
• drivers Related to the example drivers in `drivers/`.

Comments

@nbdd0121
Copy link
Member

nbdd0121 commented Jun 9, 2021

Tmpfs/ramfs sounds like a simple enough example that can both be used as a show case and a benchmark.

@nbdd0121 nbdd0121 added • drivers Related to the example drivers in `drivers/`. prio: normal labels Jun 9, 2021
@foxhlchen
Copy link

I was actually thinking about writing a debugfs in rust.
@ojeda sent me this https://gitlab.cs.washington.edu/sm237/bentofs and said Samantha Miller will be joining Zulip.
I don't know if @ojeda has a plan already??
Or maybe we can make a plan here?

@nbdd0121
Copy link
Member Author

nbdd0121 commented Jun 9, 2021

debugfs is good as well; ramfs is much simpler though :) ramfs is 641 LOC in C and debugfs in 2048 LOC.

@foxhlchen
Copy link

IIUC, Tmpfs/ramfs is bound with the driver model and device tree. it's implemented under mm/
debugfs is a normal fs.

@nbdd0121
Copy link
Member Author

nbdd0121 commented Jun 9, 2021

tmpfs is and ramfs is just a normal fs. I'll drop tmpfs from the title.

@foxhlchen
Copy link

But whatsoever, the idea is to implement a simple in-memory filesystem. Both of them are ok. :D

@nbdd0121 nbdd0121 changed the title tmpfs/ramfs as an example/benchmark ramfs as an example/benchmark Jun 9, 2021
@ojeda
Copy link
Member

ojeda commented Jun 9, 2021

No specific plan from me, so please feel free to work on an example filesystem and/or benchmark!

@foxhlchen
Copy link

Great!! So @nbdd0121, what do you think? Will you work on this?? I'm interested in this part, would you prefer to work together? Or you have other plans? Any thoughts?? 🤔

@nbdd0121
Copy link
Member Author

nbdd0121 commented Jun 9, 2021

If you want to work on it, go for it! I'll be happy to offer help or advices whenever you need them ;)

@foxhlchen
Copy link

If you want to work on it, go for it! I'll be happy to offer help or advices whenever you need them ;)

Wow! Thank you!!

@smiller123
Copy link

Hello I just saw this and see that I'm mentioned earlier in the conversation! Yes, I've written a simple in-memory FS in Rust in the kernel and a more complicated Xv6 based file system. I was writing all my own abstractions around kernel functions and have a C component to the FSes, so I don't know how well it'll match with this work, but I'm happy to work with you on it and share everything I've done so far.

@niklasmohrin
Copy link

Hey everyone! First things first, thank you all for your work on the Linux kernel :)

We, that is @bewee @TheGrayStone @taminob and me, have been working on implementing a file system using the kernel crate for a couple of months now. In fact, we have a running implementation of ramfs too, with a lot of the needed Rust abstractions. We would be very excited to work with all of you.

Our work is part of a lecture at university and we would have to come to an agreement with the lecturer before being able to take contributions to our branch, in case that is in anyone's interest. These constraints are of course lifted when the grading process is done. (Due to the same reasons, we originally wanted to wait until the end of the semester to contact you, but after we saw this issue, we felt that we may just as well introduce ourselves now.)

Our ramfs implementation is based on https://github.com/ctiedt/ramfs-loadable-module by @ctiedt (who is also our tutor and has prior work at https://github.com/ctiedt/rsramfs without the kernel crate). As none of us have worked on the linux kernel before and (in the context of the lecture) time was/is of the essence, the code is still a bit messy and doesn't always follow patterns that we found in the kernel crate (we don't have a FileSystemRegistration yet for example). We didn't write any original documentation yet either. It's nothing that can't be fixed though and we would be happy to do so.

In the next two weeks, we will also work on some basic benchmarks, which would also line up with the goals of this issue. Again, since our submission is due in a couple of weeks, we will probably not sync with your history or make our changes PR ready in this time. After that is done, we can focus on composing a sensible patch and we would be very excited to go through shorter iterations with your help, if that is in your interest.

In the meantime, you can all feel free to inspect or test the changes we made or reach out to us if you want to work together though! Our most recent work is on the fat branch of our fork, for the "stable" implementation of ramfs, I would rather advice the main branch :)

@ojeda
Copy link
Member

ojeda commented Jul 4, 2021

@niklasmohrin, @bewee, @TheGrayStone, @taminob: welcome!

Thanks for letting us know -- it is great to know the things that people are working on, for a few reasons: we can tell upstream we have more users, you can tell us any problems you may have had, others can avoid working on the very same things (or collaborate, of course!), etc.

It is reasonable that your lecturer does not allow you to take contributions until grading is over, so do not worry for the next few weeks, and good luck on your exams/grades!

@foxhlchen
Copy link

Hey everyone! First things first, thank you all for your work on the Linux kernel :)

We, that is @bewee @TheGrayStone @taminob and me, have been working on implementing a file system using the kernel crate for a couple of months now. In fact, we have a running implementation of ramfs too, with a lot of the needed Rust abstractions. We would be very excited to work with all of you.

Our work is part of a lecture at university and we would have to come to an agreement with the lecturer before being able to take contributions to our branch, in case that is in anyone's interest. These constraints are of course lifted when the grading process is done. (Due to the same reasons, we originally wanted to wait until the end of the semester to contact you, but after we saw this issue, we felt that we may just as well introduce ourselves now.)

Our ramfs implementation is based on https://github.com/ctiedt/ramfs-loadable-module by @ctiedt (who is also our tutor and has prior work at https://github.com/ctiedt/rsramfs without the kernel crate). As none of us have worked on the linux kernel before and (in the context of the lecture) time was/is of the essence, the code is still a bit messy and doesn't always follow patterns that we found in the kernel crate (we don't have a FileSystemRegistration yet for example). We didn't write any original documentation yet either. It's nothing that can't be fixed though and we would be happy to do so.

In the next two weeks, we will also work on some basic benchmarks, which would also line up with the goals of this issue. Again, since our submission is due in a couple of weeks, we will probably not sync with your history or make our changes PR ready in this time. After that is done, we can focus on composing a sensible patch and we would be very excited to go through shorter iterations with your help, if that is in your interest.

In the meantime, you can all feel free to inspect or test the changes we made or reach out to us if you want to work together though! Our most recent work is on the fat branch of our fork, for the "stable" implementation of ramfs, I would rather advice the main branch :)

Wow, Great work!! It's nice that you guys have a working implementation already.
If I knew it, I wouldn't have written this from the ground up by myself.
You make me hesitant about whether to continue my implementation. :)

Can't wait to see the benchmark.
Again thanks for the work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• drivers Related to the example drivers in `drivers/`.
Development

Successfully merging a pull request may close this issue.

5 participants