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

Add ability to override or stop tweaks locally. #14

Merged
merged 10 commits into from
Feb 11, 2020
Merged

Add ability to override or stop tweaks locally. #14

merged 10 commits into from
Feb 11, 2020

Conversation

ahkok
Copy link
Contributor

@ahkok ahkok commented Feb 7, 2020

Includes several minor bugfixes/cleanups. It's reasonably well split out.

This is needed to prepare for some sort of user-local override
mechanic - we need to be able to go through the list and avoid
writing user-specified entries. The easiest way is to have the
data available as a simple list we can iterate through in memory
so that we can skip items.

This should be easy enough to edit & compile as before.
This still tunes queue sizes.
`<disk>` was a suggestion to implement glob filtering to omit
loopback devices. We know disks are sd*, mmc* and nvme*, so, let's
start with those for now.

Unfortunately glob() doesn't appear to have a negative match filter.
This will make various patterns easier to maintain.
Introduces "/etc/clr-power-tweaks.conf" which allows to
prevent default tweaks from being written and/or add new
custom tweaks.

The custom tweaks are applied before the builtin ones. Either
nothing is written to a match or file, and the file is added to
the exclude list, or the value listed is written to the globbed
files and it is added to the exclude list.
Copy link
Contributor

@thiagomacieira thiagomacieira left a comment

Choose a reason for hiding this comment

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

All the clean up commits are fine. What's the motivation for having the overrides file? That is, for preventing clr_power from writing something? Doesn't it suffice to write the desired value after clr_power?

string_exclude(match);
};
if (ret == 2) {
write_string_to_files(match, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the feature to add more things? That's what tmpfiles.d is for, which is what this was before.

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 feel it's too horrible to have all of these in a single and logical place. It also could have gone into sysctl for the most part, or better, we'd patch the kernel defaults. But all of those risk that it becomes overly complex to sort out power related problems where "something is not tuned right" but there are 20 places it could be.

Having it here also allows us to "just disable clr-power-tweaks" as an initial problem solving step...

@ahkok
Copy link
Contributor Author

ahkok commented Feb 7, 2020

Doesn't it suffice to write the desired value after clr_power?

I want to avoid writing several times into things that touch hardware. I also want to have a mechanism to disable the program from touching some files at all, and this seemed the simplest approach, and covers both desired features.

These pages are stubs for now. This is just the build structure for them.
@ahkok ahkok merged commit 61b3b22 into master Feb 11, 2020
@ahkok ahkok deleted the localetcconf branch February 11, 2020 22:23
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.

2 participants