-
Notifications
You must be signed in to change notification settings - Fork 554
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
config-linux.md: part fix of blkio spec #825
Conversation
On Sun, May 14, 2017 at 08:36:46AM -0700, Ma Shimiao wrote:
blkioWeightDevice is not direct for bindwidth rate limit, actually
used for weight division.
Can we punt more directly to the backing kernel cgroup API? For
example, see the in-flight #745 where I'm trying to tie
`disableOOMKiller` to the `memory.oom_control` file. If the spec is
clear about how the property is mapped to the kernel API, our local
handwaving about what the value means is less important (and folks
interested in the details know what to look for in the kernel
docs/code).
|
Maybe value description is not so important in spec, but we should not give descriptions that seems not correct. |
On Tue, May 16, 2017 at 12:36:03AM -0700, Ma Shimiao wrote:
Maybe value description is not so important in spec, but we should
not give descriptions that seems not correct.
Agreed. But if you require the runtime to write the
`blkioWeightDevice` value to the `blkio.weight_device` file and link
the kernel docs, you don't have to explain what the property means.
Readers have enough information to find the meaning in the kernel
docs without us having to echo those kernel docs here.
|
@Mashimiao can you please rebase this? |
rebase, PTAL @opencontainers/runtime-spec-maintainers |
config-linux.md
Outdated
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in [mknod(1)][mknod.1] man page. | ||
* **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device | ||
|
||
* **`blkioThrottleReadIOPSDevice`**, **`blkioThrottleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be IO rate limited. | ||
The following parameters can be specified per-device: | ||
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in [mknod(1)][mknod.1] man page. | ||
* **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device |
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.
If we are not going to require these to be implemented by blkio.throttle.read_iops_device
and blkio.throttle.write_iops_device
, I suggest we at least inline the kernel's docs for those settings:
Specifies upper limit on read (or write, for
blkioThrottleWriteIOPSDevice
) rate to the device. IO rate is specified in io per second. Rules are per device.
Although I'm not sure how much we can legally copy from the GPLv2 kernel docs into this Apache-2 project. I'd much rather require these to have the same semantics as blkio.throttle.read_iops_device
and blkio.throttle.write_iops_device
, link to the kernel docs, and leave it at that.
config-linux.md
Outdated
|
||
You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. | ||
|
||
* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`**, **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be IO rate limited. | ||
* **`blkioThrottleReadBpsDevice`**, **`blkioThrottleWriteBpsDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be bandwidth rate limited. |
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.
This is re-introducing the blkio
prefix which we removed in #860.
6f4146b
to
f63941a
Compare
rebased. PTAL |
config-linux.md
Outdated
@@ -330,14 +330,19 @@ The following parameters can be specified to set up the controller: | |||
|
|||
* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. | |||
* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. | |||
* **`weightDevice`** *(array of objects, OPTIONAL)* - specifies the list of devices which will be bandwidth rate limited. The following parameters can be specified per-device: | |||
* **`weightDevice`** *(array of objects, OPTIONAL)* - specifies the list of devices which will be weight division of bandwidth. The following parameters can be specified per-device: |
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.
specifies the list of devices which will be weight division of bandwidth
This reads a bit odd to me -- perhaps "specifies the list of devices which will be bandwidth-limited by weight" ?
I don't understand why we're fixating on "weight division of bandwidth" here -- the relevant kernel doc (https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt) only uses that phrase once.
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.
@tianon How about "specifies the list of devices which has its own specific weight
and leafWeight"?
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.
As you know, "weight" and "leafWeight" are used as bandwidth-limit in default. weightDevice is used to specify per-device rules.
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 "specifies the list of devices which has its own specific weight and leafWeight"?
The “and” portion of this isn't necessarily true, since you can have just one or the other as well. And this is less about limiting and more about weighting. Also, JSON uses “array” instead of ”list”. So how about:
weightDevice
(array of objects, OPTIONAL) - an array of per-device bandwidth weights. Each entry has the following structure:
The each-entry line follows the current precedent:
$ git --no-pager grep -n 'entry.*following' v1.0.0-rc6
v1.0.0-rc6:config-linux.md:82:Each entry has the following structure:
v1.0.0-rc6:config-linux.md:115:Each entry has the following structure:
v1.0.0-rc6:config-linux.md:221:Each entry has the following structure:
v1.0.0-rc6:config-linux.md:394:Each entry has the following structure:
v1.0.0-rc6:config-linux.md:540: Each entry has the following structure:
v1.0.0-rc6:config-linux.md:555: Each entry has the following structure:
v1.0.0-rc6:config.md:165: Each entry has the following structure:
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 like this one, updated
f63941a
to
c447eb3
Compare
config-linux.md
Outdated
@@ -337,14 +337,19 @@ The following parameters can be specified to set up the controller: | |||
|
|||
* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. | |||
* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. | |||
* **`weightDevice`** *(array of objects, OPTIONAL)* - specifies the list of devices which will be bandwidth rate limited. The following parameters can be specified per-device: | |||
* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. Each entry has the following structure: |
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.
The “Each entry…” sentence should be on it's own line like it is here.
config-linux.md
Outdated
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in [mknod(1)][mknod.1] man page. | ||
* **`weight`** *(uint16, OPTIONAL)* - bandwidth rate for the device. | ||
* **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only | ||
* **`weight`** *(uint16, OPTIONAL)* - bandwidth wight for the device. |
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.
“wight” → “weight”
config-linux.md
Outdated
* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`**, **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be IO rate limited. | ||
* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be bandwidth rate limited. | ||
The following parameters can be specified per-device: | ||
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in [mknod(1)][mknod.1] man page. |
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.
The “More info” sentence should be on it's own line.
I'd also like to see it rephrased to be a more complete sentence. Following this pattern, it would be:
For more information, see the [`mknod(1)`][mknod.1] man page.
config-linux.md
Outdated
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in [mknod(1)][mknod.1] man page. | ||
* **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device | ||
|
||
* **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be IO rate limited. |
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.
For consistency (at least within lines touched by this PR), I'd rather follow weightDevice
and use something like:
throttleReadIOPSDevice
,throttleWriteIOPSDevice
(array of objects, OPTIONAL) - an array of per-device IO rate limits. Each entry has the following structure:
With “Each entry has the following structure”, you could drop the following line (“The following parameters can be specified per-device”).
config-linux.md
Outdated
|
||
You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. | ||
|
||
* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`**, **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be IO rate limited. | ||
* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - specify the list of devices which will be bandwidth rate limited. | ||
The following parameters can be specified per-device: |
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.
For consistency (at least within lines touched by this PR), I'd rather follow weightDevice
and use something like:
throttleReadBpsDevice
,throttleWriteBpsDevice
(array of objects, OPTIONAL) - an array of per-device bandwidth rate limits. Each entry has the following structure:
weightDevice is not direct for bindwidth rate limit, actually used for weight division. bpsdeivce limits are different from IOpsdevice, they are limit rate in bytes, say used for bandwidth limit will be better. Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
c447eb3
to
b27348d
Compare
updated, PTAL |
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.
b27348d looks good to me. There's the backtick nit and my preference for clearly punting to kernel APIs, but neither of those seem like blockers for this PR.
* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. | ||
Each entry has the following structure: | ||
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. | ||
For more information, see the [mknod(1)][mknod.1] man page. |
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 |
ping @opencontainers/runtime-spec-maintainers |
ping @opencontainers/runtime-spec-maintainers |
blkioWeightDevice is not direct for bindwidth rate limit, actually
used for weight division.
bpsdeivce limits are different from IOpsdevice, they are limit
rate in bytes, say used for bandwidth limit will be better.
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com