Skip to content
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

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

Mashimiao
Copy link

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

@wking
Copy link
Contributor

wking commented May 15, 2017 via email

@Mashimiao
Copy link
Author

Maybe value description is not so important in spec, but we should not give descriptions that seems not correct.

@wking
Copy link
Contributor

wking commented May 16, 2017 via email

@crosbymichael
Copy link
Member

@Mashimiao can you please rebase this?

@Mashimiao
Copy link
Author

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
Copy link
Contributor

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.
Copy link
Contributor

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.

@Mashimiao Mashimiao force-pushed the fix-blkio-spec branch 2 times, most recently from 6f4146b to f63941a Compare June 22, 2017 01:30
@Mashimiao
Copy link
Author

rebased. PTAL

@dqminh
Copy link
Contributor

dqminh commented Jul 3, 2017

LGTM

Approved with PullApprove

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:
Copy link
Member

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.

Copy link
Author

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"?

Copy link
Author

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.

Copy link
Contributor

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:

Copy link
Author

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

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:
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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:
Copy link
Contributor

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>
@Mashimiao
Copy link
Author

updated, PTAL

Copy link
Contributor

@wking wking left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer backticks around man page references (e.g. here and here), but that's clearly not a big deal.

@TomSweeneyRedHat
Copy link

LGTM

@Mashimiao
Copy link
Author

ping @opencontainers/runtime-spec-maintainers

@crosbymichael
Copy link
Member

crosbymichael commented Aug 17, 2017

LGTM

Approved with PullApprove

@Mashimiao
Copy link
Author

ping @opencontainers/runtime-spec-maintainers

@hqhq
Copy link
Contributor

hqhq commented Aug 22, 2017

LGTM

Approved with PullApprove

@hqhq hqhq merged commit 3294695 into opencontainers:master Aug 22, 2017
@vbatts vbatts mentioned this pull request Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants