pub struct PageCache {
priority: usize,
block_ids: [usize; 8],
page_ptr: &'static mut [u8; 4096],
tracker: Arc<FrameTracker>,
}
Expand description
PageCache is used for kernel. Each PageCache contains PAGE_BUFFERS(8) BufferCache.
Fields
priority: usize
Priority is used for out of memory Every time kernel tried to alloc this pagecache this number will increase 1(at most 3) Every time out of memory occurred this number will decrease 1(at least 0) When it’s 0 and Arc’s strong count is 1(one in inode) this PageCache will be dropped
block_ids: [usize; 8]
If block_id is usize::Max, content in this block won’t be writed back
page_ptr: &'static mut [u8; 4096]
tracker: Arc<FrameTracker>