-
Notifications
You must be signed in to change notification settings - Fork 8
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
packages: add general io utils #17
Conversation
97e77c6
to
edc9fd7
Compare
edc9fd7
to
a379f38
Compare
0bcf9b1
to
2598c88
Compare
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.
Please take a look, and I will help to double-check the alignment issue you mentioned to me, thanks.
io/io.go
Outdated
_, err := PReadExact(src, buf, chunkSize, uint64(i*chunkSize)) | ||
if err != nil { | ||
fmt.Printf("Error reading data: %v\n", err) | ||
ioError = err | ||
continue | ||
} | ||
objs <- Content{offset: uint64(i * chunkSize), buf: buf} |
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.
Maybe we should have continuous direct reads in a single go routine?
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.
Could you elaborate more on your concerns about the single go routine (single producer) instead of the multi-producer?
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.
I don't mean to only have a single producer. IIUC, We will have 8 (from producerNum
) producers, and in each producer, the read address is not continuous. For example, the first producer will read the address of chunk numbers 0, 8, 16, 24 ... so on. It could be just a nit for non-rotational devices. I'm ok with the current design, just a discussion. 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.
Sounds good to me. Now, each producer will handle the continuous offset to read.
df1fa6b
to
79007d3
Compare
Thanks @WebberHuang1118. So, I dropped the dynamic alignment size when calling posix_memalign, which would also simplify the code. |
79007d3
to
2d3c9ae
Compare
22df88a
to
47189b1
Compare
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.
LGTM, I'm just wondering if the wait group and channel handling are a little complex, however, I'm not sure if there is a simpler way to deal with this. I will try to figure it out and discuss it with you if I find one, thanks.
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.
LGTM. Thank you.
47189b1
to
e92c23d
Compare
- suppport parallel ioReader/ioWriter - skip the zero buffer Signed-off-by: Vicente Cheng <[email protected]>
e92c23d
to
1982bab
Compare
It will be used for general volume clones.