34 Commits

Author SHA1 Message Date
Kai Krakow
62865b1e32 gamemode: Apply io priority to clients
This commit allows changing the io priority of the client to a value
specified in the configuration file. That can possibly reduce lags or
latency when a game has to load assets on demand and you have background
IO activity running (or other concurrent IO).

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-10-03 04:24:56 +02:00
Alex Smith
7af744250e README: Mention Fedora packages
GameMode is now in the official Fedora repository.
2018-09-29 09:27:48 +01:00
Kai Krakow
af8c2a7c4a README: Mention Gentoo support
Gentoo has merged the gamemode ebuild into portage as of:
https://github.com/gentoo/gentoo/pull/9700#issuecomment-423886373

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-09-24 09:13:24 +02:00
Alex Smith
c3938599a8 Update to version 1.2 2018-07-21 09:33:32 +01:00
Alex Smith
f6786ed5d2 Further formatting fixes 2018-07-13 10:32:34 +01:00
Alex Smith
3645b43416 Fix formatting 2018-07-13 10:31:57 +01:00
Alex Smith
407a7b2d0a Document how to uninstall
Issue #59.
2018-07-13 10:30:55 +01:00
Christian Kellner
1369629972 README.md: use version library in examples
Now that versioned libraries are created, use that in the examples
provided.
2018-07-02 14:14:47 +02:00
Dennis E. Mungai
e85dc3ecfb Added build notes for the git master
The build instructions here only cater for release 1.1.
This adds in build notes for the master branch.
2018-06-21 05:52:03 +03:00
Kai Krakow
ead417be36 docs: Add a warning about potential resource starvation
Warn the user about adjusting `SCHED_ISO` to too high CPU usage values
as it may render the OS unresponsive.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-06-10 10:07:23 +02:00
Kai Krakow
048b7b1c17 docs: Document priority inversion caveats
Depending on the local system architecture and the game architecture,
changes to the scheduling may result in priority inversion which has
counter-intuitive effects on performance. Let's document these to give
the user a chance to detect and fix this problem.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-06-10 09:38:57 +02:00
Kai Krakow
57c6bbb444 config: Allow renice configuration
This commit adds configuration support for the renice value and amends
documentation and examples. This commit by itself does nothing, the
following commit is needed to actually apply the new settings.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-06-10 09:33:02 +02:00
Kai Krakow
76ece2fc26 Leverage soft real time capabilities
Kernels that support SCHED_ISO scheduling policy can give processes soft
real time support. This improves latency without compromising system
stability. See https://lwn.net/Articles/720227/.

This commit adds support for setting this policy with a safe fall back if
kernel support is lacking by just ignoring the error condition.

Additionally, it also tries to raise the nice priority of the game to -4
to give it a slight IO and CPU priority over other background processes.
This needs PAM adjustments to allow users raising priority to certain
levels. If it doesn't work, the fall back strategy is also ignoring the
error condition. See /etc/security/limits.conf.

Kernels that currently support SCHED_ISO include kernels with Con
Kolivas MuQSS patchset (likely the CK patchset). This patchset is
generally recommended for desktop machines but usually not found in
standard distribution kernels due to lack of widespread stability tests.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-05-23 22:23:42 +02:00
Alex Smith-Fanning
2c68ae67e6 added info about overclocking (#49)
* added info about overclocking
2018-05-11 15:12:25 +01:00
Marc Di Luzio
1dc641ca59 Add a note for dbus-user-session as seen in issues like #48 2018-05-11 08:59:51 +01:00
Marc Di Luzio
907a690e39 Merge branch 'master' into 1.1RC 2018-05-01 15:45:57 +01:00
Marc Di Luzio
808f5c9159 Provide a cascaded merge-overwrite config approach for #6
gamemoded will now load and merge settings from the following locations - arrays will merge and single settings will overwrite.

	1. /usr/share/gamemode/
	2. /etc/
	3. $XDG_CONFIG_HOME or $HOME/.config/
	4. $PWD
2018-05-01 15:42:54 +01:00
Marc Di Luzio
fb2f3c628a Update to 1.1 ready for release 2018-04-25 15:50:05 +01:00
Marc Di Luzio
4f3bc2c9a2 Add gamemode_query_status and teach gamemoded '-s'
This allows the client to query the daemon about the status of gamemode.

	Returns the following:
		 0 if gamemode is inactive
		 1 if gamemode is active
		 2 if gamemode is active and this client is registered
		-1 if the query failed

	Passing -s to gamemoded will simply query and print the current status.

	Allows for more comprehensive testing when using 'gamemoded -r' as well as more reactionary program behaviour
2018-04-25 14:51:38 +01:00
Marc Di Luzio
3ac1b681c4 Exclude submodules from the format suggestion 2018-04-25 14:45:51 +01:00
Marc Di Luzio
b370369d80 Update README.md 2018-04-24 17:23:02 +01:00
Marc Di Luzio
db8a70b7ba Add support for user defined local script plugins
A much requested feature, this allows for providing custom scripts in the config file. An example in the man page is below and would trigger both a system notification, and allow control over a background crypto mining script automatically in gamemode.

	[custom]
	; Custom scripts (executed using the shell) when gamemode starts and ends
	start=notify-send "GameMode started"
	    /home/me/bin/stop_ethmining.sh

	end=notify-send "GameMode ended"
	    /home/me/bin/start_ethmining.sh

	Scripts are run with system() and do not have any special privilages, as with the rest of the daemon, custom scripts that require root will need their own permissions set up externally.

	This commit also renames two defines as they needed to be moved to the public interface.
2018-04-24 16:59:17 +01:00
Marc Di Luzio
51e1e7203f Add "reaper_freq" config setting in the "general" section
This simply allows control over the reaper thread frequency.

	Defaults to 5 as before.
2018-04-24 14:37:39 +01:00
Marc Di Luzio
9472a71602 Add git to the install dependencies as seen in #36 2018-04-24 13:43:44 +01:00
grmat
66e805c481 doc/examples: remove 'ninja' as explicit dep (#4)
as it's already required by meson.
Also use the default unit file path (/usr/lib/systemd/user/) for
packaged versions. /etc/systemd/user is intended for manually installed
services.

arch-meson is just a Meson wrapper with correct arch packaging prefixes set.
2018-04-13 10:28:00 +01:00
Marc Di Luzio
9e2188c94e Update README.md
* Install off the 1.0 tag not master
* Generally remove some headers to clean up the view on GitHub
* Link to contributors page as we now have more than 2
2018-04-13 10:24:48 +01:00
Bruno Thomsen
3a91960fb5 README: added Fedora build requirements.
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
2018-04-11 10:14:33 +01:00
Marc Di Luzio
2e710c2d2d Update README.md
Add a note about distribution packages being preferable.
2018-04-10 14:59:21 +01:00
Marc Di Luzio
4f14c807ba 1.0: Finalised for release
Updating the README.md to bring it ready for wider release:
* Removed some points that were more implementation details
* Added Contributions section
* Simplified the usage section
* Expanded initial explanation
* Fixed steam launch command to allow the overlay to still work

Others:
* Mark as 1.0
* Update the license file for 2018
2018-04-04 10:06:23 +01:00
Marc Di Luzio
759cbc3c40 Add config file parsing
Checks for a gamemode.ini in /usr/share/gamemode/ (or in the cwd for debugging)

	Currently allows for blacklisting and whitelisting clients based on rudimentary needle-haystack executable name checks

	See the example/gamemode.ini file for expected syntax

	Using the BSD licensed inih library (with additional meson.build file)
2018-03-23 16:59:15 +00:00
Marc Di Luzio
73fb3e97e6 Update README.md for 0.2 release
Add pkg-config for ubuntu
	Suggest using bootstrap script
	Change TODO section into a planned features section
	Add changelog file
2018-03-23 16:59:01 +00:00
Ikey Doherty
9e36ffe9f9 Use correct LIB escaping for LD_PRELOAD
This ensures we use the architecture independent path in the environment
variable, allowing multiarch + multilib system paths to be respected.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-03-05 17:32:02 +00:00
Marc Di Luzio
ee1c51d0b0 Add clang format file
This is a slightly modified version of Ikey's format for usysconf found here: https://github.com/solus-project/usysconf/blob/master/.clang-format

Modifications are to change to tab indentation, and tab/indent widths of 4
You'll never please everyone, but I find tabs for indentation is the most pragmatic approach to keeping most people happy about indent length arguments.
2018-03-05 17:32:01 +00:00
Marc Di Luzio
c459c05076 Initial 0.1 commit
This is a small daemon/libary to enable games to request a
performance "game mode" from the system.

Currently only implemented to upgrade the CPU governor and
automatically downgrade it once done.

A game only needs to load libgamemodeauto to activate the request.
Which means an LD_PRELOAD can be applied to any game to activate
the mode as needed.

However gamemode_client.h can be used to manually activate/deactivate
the mode as needed, and also perform error checking.

The libs are miminal loaders to call into an installed libgamemode
which, if the daemon is installed and running, will send through
the equivelant game mode request, and magic will happen.

See the README.md for more details.

Currently licensed under the BSD 3 clause license.
2018-03-05 17:32:01 +00:00