Add columns for process autogroup identifier and nice value

Adds AGRP (autogroup) and ANI (autogroup nice) columns that
report the information from /proc/PID/autogroup, as well as
handlers for '{' and '}' to change the autogroup nice value.

This is guarded by /proc/sys/kernel/sched_autogroup_enabled
such that sampling and/or changing values wont be attempted
unless the kernel feature is enabled.

Fixes: #720
This commit is contained in:
Nathan Scott
2021-08-06 16:45:30 +10:00
committed by BenBE
parent aa0424ade8
commit 1bd95983b2
13 changed files with 201 additions and 10 deletions

View File

@ -28,6 +28,7 @@ in the source distribution for its full text.
#define PROCESS_FLAG_LINUX_SECATTR 0x00008000
#define PROCESS_FLAG_LINUX_LRS_FIX 0x00010000
#define PROCESS_FLAG_LINUX_DELAYACCT 0x00040000
#define PROCESS_FLAG_LINUX_AUTOGROUP 0x00080000
typedef struct LinuxProcess_ {
Process super;
@ -99,6 +100,10 @@ typedef struct LinuxProcess_ {
unsigned long ctxt_diff;
char* secattr;
unsigned long long int last_mlrs_calctime;
/* Autogroup scheduling (CFS) information */
long int autogroup_id;
int autogroup_nice;
} LinuxProcess;
extern int pageSize;
@ -117,6 +122,10 @@ IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this);
bool LinuxProcess_setIOPriority(Process* this, Arg ioprio);
bool LinuxProcess_isAutogroupEnabled(void);
bool LinuxProcess_changeAutogroupPriorityBy(Process* this, Arg delta);
bool Process_isThread(const Process* this);
#endif