-
-
Notifications
You must be signed in to change notification settings - Fork 158
BlockCache支持 #521
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
BlockCache支持 #521
Conversation
这个是只有读缓存吗,我貌似没看到写的 |
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.
有几个疑问
- CacheBlock和BlockData的作用分别是什么,我觉得应该是用一个CacheHeader管理元数据,然后里面用一个指针指向缓冲区里的块数据,Iter就迭代CacheHeader就可以了
- 我感觉你只要在BlockDevice的Readat/Writeat操作的时候,在ext/fat等具体文件系统实现的Readat/Writerat之前,对是否存在cache判断就可以了,而不用把每个readat和writeat都重载吧
- 回写你可以先做个立即回写然后sync
|
||
impl BlockCache { | ||
/// @brief 初始化BlockCache需要的结构体 | ||
pub fn init() { |
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.
这个可以用unified_init宏进行统一初始化
@chiichen zj说这个搞好了,麻烦看看 |
有几个我review到的点还没改,要是觉得不需要改动的地方也说一下觉得不需要改动的原因呗哈哈哈 @ZZJJWarth |
内存分配的问题是不是有特定的接口啥的实现?还是说这是一个新的系统?(这个如果要实现可以作为下一个pr) |
是哪个函数死锁,看看有没有对应的issue在这里 @ 一下,没有的话发个issue看看 |
我估摸着是文件的那里有个lock_no_preempt造成的。 |
@dragonosbot author |
这个PR的问题非常多,请一个个comment详细确认并修改。 同时,block cache不应该放在 |
… into dev_block_cache
… into dev_block_cache
@dragonosbot ready |
目前测试没有问题,但是暂时没有进行并发测试
加锁的问题还没有考虑:<
注释已经加上了