mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-07 13:48:30 +02:00
Set up for resetting niceness value
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)
This commit is contained in:
@@ -71,6 +71,8 @@ struct GameModeContext {
|
||||
struct GameModeGPUInfo *stored_gpu; /**<Stored GPU info for the current GPU */
|
||||
struct GameModeGPUInfo *target_gpu; /**<Target GPU info for the current GPU */
|
||||
|
||||
int initial_renice; /**<Initial renice value */
|
||||
|
||||
/* Reaper control */
|
||||
struct {
|
||||
pthread_t thread;
|
||||
@@ -412,8 +414,11 @@ int game_mode_context_register(GameModeContext *self, pid_t client, pid_t reques
|
||||
game_mode_context_enter(self);
|
||||
}
|
||||
|
||||
/* Store current renice and apply */
|
||||
self->initial_renice = game_mode_get_renice(client);
|
||||
game_mode_apply_renice(self, client, 0 /* expect zero value to start with */);
|
||||
|
||||
/* Apply scheduler policies */
|
||||
game_mode_apply_renice(self, client);
|
||||
game_mode_apply_scheduling(self, client);
|
||||
|
||||
/* Apply io priorities */
|
||||
|
Reference in New Issue
Block a user