Skip to content

Commit

Permalink
Linux: update gathering information regarding threads
Browse files Browse the repository at this point in the history
Document for each block gathering information about a task whether the
information is shared for the whole process or specific to a single
userland thread.

Also avoid system calls for process-shared information and reuse the
information from the main task.
  • Loading branch information
cgzones committed Apr 6, 2024
1 parent b4d5b5c commit 48181bc
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 39 deletions.
3 changes: 3 additions & 0 deletions Scheduling.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ const char* Scheduling_formatPolicy(int policy) {
}
}

/*
* Gather scheduling policy (thread-specific data)
*/
void Scheduling_readProcessPolicy(Process* proc) {
proc->scheduling_policy = sched_getscheduler(Process_getPid(proc));
}
Expand Down
3 changes: 3 additions & 0 deletions linux/LibNl.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) {
return NL_OK;
}

/*
* Gather delay-accounting information (thread-specific data)
*/
void LibNl_readDelayAcctData(LinuxProcessTable* this, LinuxProcess* process) {
struct nl_msg* msg;

Expand Down
3 changes: 3 additions & 0 deletions linux/LinuxProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ static int LinuxProcess_effectiveIOPriority(const LinuxProcess* this) {
#define SYS_ioprio_set __NR_ioprio_set
#endif

/*
* Gather I/O scheduling class and priority (thread-specific data)
*/
IOPriority LinuxProcess_updateIOPriority(Process* p) {
IOPriority ioprio = 0;
// Other OSes masquerading as Linux (NetBSD?) don't have this syscall
Expand Down
Loading

0 comments on commit 48181bc

Please sign in to comment.