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

ioprio and niceness fixes, and long cmdline options #142

Merged
merged 28 commits into from
May 19, 2019

Conversation

mdiluz
Copy link
Contributor

@mdiluz mdiluz commented May 11, 2019

This PR has the following changes:

Help now looks like:

Usage: gamemoded [-d] [-l] [-r] [-t] [-h] [-v]

  -r[PID], --request=[PID] Toggle gamemode for process
                           When no PID given, requests gamemode and pauses
  -s[PID], --status=[PID]  Query the status of gamemode for process
                           When no PID given, queries the status globally
  -d, --daemonize          Daemonize self after launch
  -l, --log-to-syslog      Log to syslog
  -r, --test               Run tests
  -h, --help               Print this help
  -v, --version            Print version

See man page for more information.

I've also implemented tests for the two fixes above, both a302168 and a6e238d can be run to show the tests failing, before the subsequent fixes

mdiluz added 9 commits May 11, 2019 12:08
	Add tests to check this feature
	Apply config validation in config for simplicity

	Note: if anything messes with the niceness (ie. it starts non-zero, or it's not the expected value during setup, we'll bail out)
	Implements tests for feature

	Fixes CLAMP macro
@mdiluz mdiluz changed the title ioprio and niceness resetting, improved cmdline options WIP: ioprio and niceness resetting, improved cmdline options May 11, 2019
@mdiluz
Copy link
Contributor Author

mdiluz commented May 11, 2019

Edited title to reflect WIP - at the moment this doesn't cope with multiple clients, will need to sort that out.

	1. We don't use them anyway (though that could be a feature request)
	2. They weren't stored per-client, so would be incorrect anyway
@mdiluz mdiluz changed the title WIP: ioprio and niceness resetting, improved cmdline options ioprio and niceness resetting, improved cmdline options May 11, 2019
@mdiluz
Copy link
Contributor Author

mdiluz commented May 11, 2019

20d014b fixes the problem for now.

We don't mess with niceness or ioprio values that are non-default anyway, so there's no need to store the initial value.

A future change might be to make these values an offset, or something else, but I worry that's being too clever - if a program is adjusting them itself, we should probably not mess with it.

@mdiluz mdiluz changed the title ioprio and niceness resetting, improved cmdline options ioprio and niceness fixes, and long cmdline options May 13, 2019
@mdiluz
Copy link
Contributor Author

mdiluz commented May 13, 2019

I've now implemented multithreaded program fixes for ioprio and niceness optimizations, as well as tests for those implementations

@aejsmith aejsmith merged commit 0849168 into FeralInteractive:master May 19, 2019
@mdiluz mdiluz deleted the fixes-and-longoptions branch May 25, 2019 13:50
afayaz-feral pushed a commit that referenced this pull request May 26, 2020
ioprio and niceness fixes, and long cmdline options
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.

3 participants