-
Notifications
You must be signed in to change notification settings - Fork 208
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
nydusd: add the config support of amplify_io
#1452
Conversation
3ea439d
to
760fbcb
Compare
Codecov Report
@@ Coverage Diff @@
## master #1452 +/- ##
==========================================
+ Coverage 62.49% 62.50% +0.01%
==========================================
Files 123 123
Lines 43131 43148 +17
Branches 43131 43148 +17
==========================================
+ Hits 26955 26970 +15
- Misses 14868 14870 +2
Partials 1308 1308
|
@jiangliu PTAL. |
02c2c25
to
922a192
Compare
003ecc0
to
65a874b
Compare
2dbd1e7
to
88edb18
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, Thanks!
api/src/config.rs
Outdated
@@ -681,10 +681,10 @@ impl CacheConfigV2 { | |||
} | |||
|
|||
if self.prefetch.enable { | |||
if self.prefetch.batch_size > 0x10000000 { | |||
if self.prefetch.prefetch_request_batch_size > 0x10000000 { |
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.
It's an field in inside prefetch
, so why adding prefetch_request
prefix?
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.
There's at least three types of batch_size
in nydus. Is it explicit enough to leave it as batch_size
?
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.
Reverted to prefetch.batch_size
. Please reply again if there's some other problems.
@@ -117,6 +117,10 @@ impl BlobFactory { | |||
) -> IOResult<Arc<dyn BlobCache>> { | |||
let backend_cfg = config.get_backend_config()?; | |||
let cache_cfg = config.get_cache_config()?; | |||
let user_io_batch_size = config | |||
.get_rafs_config() | |||
.map_or_else(|_| default_user_io_batch_size(), |v| v.user_io_batch_size) |
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.
Should be?
.map_or_else(default_user_io_batch_size, |v| v.user_io_batch_size)
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.
function is expected to take 1 argument, but it takes 0 arguments
expected function that takes 1 argument
storage/src/cache/cachedfile.rs
Outdated
@@ -300,19 +301,19 @@ impl FileCacheEntry { | |||
} | |||
} | |||
|
|||
fn prefetch_batch_size(&self) -> u64 { | |||
if self.prefetch_config.merging_size < 0x2_0000 { | |||
fn prefetch_request_batch_size(&self) -> 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.
How about prefetch_batch_size()
?
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.
Changed.
Variable names about prefetch are confused currently. So we merge variable names that have the same meaning, while DO NOT affect the field names read from the configuration file. Signed-off-by: Wenhao Ren <wenhaoren@mail.dlut.edu.cn>
Add the support of `amplify_io` in the config file of nydusd to configure read amplification. Signed-off-by: Wenhao Ren <wenhaoren@mail.dlut.edu.cn>
Relevant Issue (if applicable)
If there are Issues related to this PullRequest, please list it.
Details
Please describe the details of PullRequest.
The first commit is to rename the variables with similar usages into same names.
i.e.,
prefetch.batch_size
/prefetch.merging_size
->batch_size
(filed name)/prefetch_batch_size
(function name) (newly changed)threads
/threads_count
->threads_count
batch_size
/amplify_io
->user_io_batch_size
bandwidth_rate
/bandwidth_limit
->bandwidth_limit
This change is only for the variables in nydusd runtime, and does not affect the filed names in the config file.
The second commit adds the support of
amplify_io
in the config file of nydusd to restrict read amplification.Types of changes
What types of changes does your PullRequest introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.