From 1bd95983b2703cb313ea301367ff3199fabd1f9d Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 6 Aug 2021 16:45:30 +1000 Subject: 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 --- linux/LinuxProcess.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linux/LinuxProcess.h') diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 5f77db2e..bca5247a 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -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 -- cgit v1.2.3