-
Notifications
You must be signed in to change notification settings - Fork 204
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
Add capability of prefetch for rafs v6 format #319
Conversation
bios.iter_mut().for_each(|b| { | ||
if let Some(ref chunks_meta) = self.meta { | ||
// TODO: the first blob backend io triggers chunks array download. | ||
if let BlobIoChunk::Address(_blob_index, chunk_index) = b.chunkinfo { |
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.
Not related to this PR, but it looks a bit wired to construct BlobIoChunk::Address
and convert it to BlobIoChunk::Base
for v6 IO desc. Looks like we can just create BlobIoChunk::Base
and remove BlobIoChunk::Address
. @jiangliu wdyt?
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.
Thanks a lot!
rafs/src/metadata/layout/v6.rs
Outdated
pub struct RafsV6PrefetchTable { | ||
/// List of inode numbers for prefetch. | ||
/// Note: It's not inode index of inodes table being stored here. | ||
pub inodes: Vec<u64>, |
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.
Hi, we could use 32bit nid here, since blob.meta won't be too large for nydus v6 format.
it can support 4*32 = 128GB bootstrap size, which I think it's enough
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.
already changed to u32
Place a prefetch table which has nids for files and directories that needs to be prefetched. The prefetch table is very close to blobs table on v6 rafs extended super block. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Load v6 prefetch table from extended super block and prefetch files' contents per as the table. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Because seek is transitive. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Rafs prefetch needs the functionality. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
V6 format does not have chunks' particualer addresses in bootstrap but only their indexes by which to locate each chunk from blob. For prefetch, we aslo have to map the chunks info so that bios can be sorted when handling prefetch requests. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Right now, when prefetch enabled and xattrs packed, extended sb will be revised and rewritten more than onece. It is not necessary. Only write extended block when all the settings are done. Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
Rafs v6 now has the capability of prefetch with this patch set merged if it would.
By design, it places a prefetch table very closely to blob devices table on v6 extended block when creating v6 nydus image.
The
nydus-image
command line user interface is exactly the same with v5 style. Each file that needs to be prefetched will have itsnid
persisted into the prefetch table.When nydusd starts, the prefetching files will be found from the prefetch table and the files' contents will be downloaded in ahead of time.