Skip to content

setpriority

Intro

setpriority - modifies the scheduling priority of specified process

Description

The setpriority() system call is used to modify the scheduling priority of specified process or process group.

The which argument allows the priority of one of the following selections to be changed: * PRIO_PROCESS - change the priority of specified process * PRIO_PGRP - change the priority of all processes in the specified process group * PRIO_USER - change the priority of all processes for the specified user

The who argument specifies the process, process group, or user the priority of which is to be changed. The who argment should be different from 0 to specify a process instead of a process group or user.

The prio argument allows the priority to be specified as a value in the range -20 to 19. A lower numerical value causes a process to be scheduled with higher priority.

Arguments

  • which:int[K] - specifies which selection is to be modified
  • who:int[K] - user ID of the process or process group to be modified
  • prio:int[K] - the new priority value in the range -20 to 19

Available Tags

  • K - Originated from kernel-space.

Hooks

sys_setpriority

Type

Kprobe

Purpose

Capture information about process scheduling priority changes

Example Use Case

The setpriority() system call can be used to customize the scheduling priorities for certain processes on the system. For example, setting the scheduling priority of a process containing a real-time task to a higher priority than that of other processes.

Issues

This system call only gives priority to processes with non-real-time priority scheduling. Real-time priority schedulers should be done with other syscalls.

  • sched_setattr() - sets attributes for process scheduling

This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.