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

scheduler: added default_irq_smp_affinity option #306

Merged
merged 1 commit into from Nov 14, 2020

Conversation

yarda
Copy link
Contributor

@yarda yarda commented Nov 10, 2020

The option 'default_irq_smp_affinity' affects what will be written to the
/proc/irq/default_smp_affinity. The option supports the following values:

calc:
Content of the /proc/irq/default_smp_affinity will be calculated from
the 'isolated_cores'. Non-isolated cores are calculated as an inversion
of the 'isolated_cores'. Then the intersection of the non-isolated cores
and the previous content of the /proc/irq/default_smp_affinity is
written to the /proc/irq/default_smp_affinity. If the intersection is
empty set, then just the non-isolated cores are written to the
/proc/irq/default_smp_affinity. This behavior is the default if
option 'default_irq_smp_affinity' is not specified.

ignore:
The /proc/irq/default_smp_affinity is not touched by Tuned.

cpulist like e.g. '1,3-4':
The cpulist is unpacked and directly written to the
/proc/irq/default_smp_affinity

Examples:

[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = calc

[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = ignore

[scheduler]
isolated_cores = 1, 3
default_irq_smp_affinity = 2, 4

Resolves: rhbz#1896348

Signed-off-by: Jaroslav Škarvada jskarvad@redhat.com

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/redhat-performance-tuned-306
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Copy link

@marcel-apf marcel-apf left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@jmencak
Copy link
Contributor

jmencak commented Nov 11, 2020

I know the comment above and commit message could be considered a sort of a documentation, but really, it is not. Can we start a practice of adding documentation to every new feature such as this directly in the doc/manual/... ?

@yarda
Copy link
Contributor Author

yarda commented Nov 11, 2020

I know the comment above and commit message could be considered a sort of a documentation, but really, it is not. Can we start a practice of adding documentation to every new feature such as this directly in the doc/manual/... ?

It's good idea, I will try to transform the commit message into the asciidoc text.

@jmencak
Copy link
Contributor

jmencak commented Nov 11, 2020

I've tested the default behaviour is unchanged + calc/ignore/cpulist seem to work too. Rollback also works. After the docs are added, happy to "lgtm".

@yarda
Copy link
Contributor Author

yarda commented Nov 11, 2020

An attempt to document this change.

After more thinking about it, I think this is not the best way to go. We should probably write such documentation into the code (e.g. by using docstrings) and then automatically generate structured reference guide from it. But it will require more man power to kick this in.

@yarda
Copy link
Contributor Author

yarda commented Nov 11, 2020

We can keep the whole asciidoc documentation (and further extend it), but I think that the chapter regarding the plugins and their options/parameters should be auto generated. This will allow easy maintenance.

@yarda
Copy link
Contributor Author

yarda commented Nov 11, 2020

Maybe there are still some 'wording' problems in the documentation added by this commit, waiting for feedback.

Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

Thanks for the docs! Looks good, minor nits a documentation writer or a native English speaker should confirm.

`scheduler`::
Allows tuning of scheduling priorities, processes/threads/IRQs affinities, and CPU cores isolation.
+
The `default_irq_smp_affinity` parameter controls what *Tuned* will write to the `/proc/irq/default_smp_affinity`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
s/what Tuned will write/the values Tuned writes/
s/to the/to/
Even though the file is "unique" I believe 'the' should be dropped as it is is "name". A document person should review this.

The following values are supported:
+
--
** `calc` content of the `/proc/irq/default_smp_affinity` will be calculated from the `isolated_cores` parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/of the/of/ (everywhere where you refer to the file :)

+
--
** `calc` content of the `/proc/irq/default_smp_affinity` will be calculated from the `isolated_cores` parameter.
Non-isolated cores are calculated as an inversion of the `isolated_cores`. Then the intersection of the non-isolated cores
Copy link
Contributor

Choose a reason for hiding this comment

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

s/of the isolated_cores/of isolated_cores/ I don't see isolated_cores mentioned anywhere, therefore I'd drop it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's mentioned on the previous line. I think the parameter isolated_cores should be described in its own paragraph preceding this text, but it's out of the context of this commit, so I didn't add it.

** `calc` content of the `/proc/irq/default_smp_affinity` will be calculated from the `isolated_cores` parameter.
Non-isolated cores are calculated as an inversion of the `isolated_cores`. Then the intersection of the non-isolated cores
and the previous content of the `/proc/irq/default_smp_affinity` is written to the `/proc/irq/default_smp_affinity`.
If the intersection is empty set, then just the non-isolated cores are written to the `/proc/irq/default_smp_affinity`.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/is empty/is an empty/

If the intersection is empty set, then just the non-isolated cores are written to the `/proc/irq/default_smp_affinity`.
This behavior is the default if the parameter `default_irq_smp_affinity` is omitted.
** `ignore` *Tuned* will not touch `/proc/irq/default_smp_affinity`.
** cpulist like e.g. `1,3-4` the cpulist is unpacked and directly written to the `/proc/irq/default_smp_affinity`.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/cpulist like e.g./for a cpulist such as/

Copy link
Contributor Author

@yarda yarda Nov 11, 2020

Choose a reason for hiding this comment

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

It's list describing 'calc', 'ignore', and cpulist parameters and it's introduced by the sentence: 'The following values are supported:', that's why I didn't want to write 'for a cpulist' but just 'cpulist'. I added dashes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reformatted the text to use asciidoc description, but I am not sure whether it looks better, nor whether the syntax I used is correct :)

@jmencak
Copy link
Contributor

jmencak commented Nov 11, 2020

@courtneypacheco , could you please go over the docs? Thank you!

@yarda
Copy link
Contributor Author

yarda commented Nov 11, 2020

I addressed most of the issues except those where I put comment.

Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

Just a minor nit. Looks good to me otherwise, thank you. I've asked Courtney to review this as a native speaker of English. You may want to give her a day or two before this merges. Thank you. /cc @courtneypacheco

`ignore`::
*Tuned* will not touch `/proc/irq/default_smp_affinity`.
cpulist such as `1,3-4`::
The cpulist is unpacked and directly written to `/proc/irq/default_smp_affinity`.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/directly written/written directly/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know :) but I changed it.

The option 'default_irq_smp_affinity' affects what will be written to the
/proc/irq/default_smp_affinity. The option supports the following values:

calc:
  Content of the /proc/irq/default_smp_affinity will be calculated from
  the 'isolated_cores'. Non-isolated cores are calculated as an inversion
  of the 'isolated_cores'. Then the intersection of the non-isolated cores
  and the previous content of the /proc/irq/default_smp_affinity is
  written to the /proc/irq/default_smp_affinity. If the intersection is
  empty set, then just the non-isolated cores are written to the
  /proc/irq/default_smp_affinity. This behavior is the default if
  option 'default_irq_smp_affinity' is not specified.

ignore:
  The /proc/irq/default_smp_affinity is not touched by Tuned.

cpulist like e.g. '1,3-4':
  The cpulist is unpacked and directly written to the
  /proc/irq/default_smp_affinity

Examples:

[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = calc

[scheduler]
isolated_cores = 1, 2
default_irq_smp_affinity = ignore

[scheduler]
isolated_cores = 1, 3
default_irq_smp_affinity = 2, 4

Resolves: rhbz#1896348

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
@jmencak
Copy link
Contributor

jmencak commented Nov 12, 2020

The rendered asciidoc looks OK to me. Still /lgtm

@jmencak
Copy link
Contributor

jmencak commented Nov 14, 2020

It is unlikely we are getting a native-speaker review of the docs within a reasonable timeframe. I believe this looks good and is good to go, @yarda

@yarda
Copy link
Contributor Author

yarda commented Nov 14, 2020

OK, thanks for info. I also think there is no point in blocking the merge due to it. We can update the text anytime later.

@yarda yarda merged commit 23dcbd7 into redhat-performance:master Nov 14, 2020
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.

None yet

3 participants