MentOS  0.8.0
The Mentoring Operating System
Macros | Variables
prio.h File Reference

Defines processes priority value. More...

Go to the source code of this file.

Macros

#define MAX_NICE   +19
 Max niceness value.
 
#define MIN_NICE   -20
 Min niceness value.
 
#define NICE_WIDTH   (MAX_NICE - MIN_NICE + 1)
 Niceness range.
 
#define MAX_RT_PRIO   100
 Maximum real-time priority.
 
#define MAX_PRIO   (MAX_RT_PRIO + NICE_WIDTH)
 Maximum priority.
 
#define DEFAULT_PRIO   (MAX_RT_PRIO + NICE_WIDTH / 2)
 Default priority.
 
#define NICE_TO_PRIO(nice)   ((nice) + DEFAULT_PRIO)
 Converts user-nice values [ -20 ... 0 ... 19 ] to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ].
 
#define PRIO_TO_NICE(prio)   ((prio)-DEFAULT_PRIO)
 Converts static priority [ MAX_RT_PRIO..MAX_PRIO-1 ] to user-nice values [ -20 ... 0 ... 19 ].
 
#define USER_PRIO(p)   ((p)-MAX_RT_PRIO)
 'User priority' is the nice value converted to something we can work with better when scaling various scheduler parameters, it's a [ 0 ... 39 ] range.
 
#define TASK_USER_PRIO(p)   USER_PRIO((p)->static_prio)
 Provide easy access to the priority value of a task_struct.
 
#define MAX_USER_PRIO   (USER_PRIO(MAX_PRIO))
 The maximum priority for a user process.
 
#define GET_WEIGHT(prio)   prio_to_weight[USER_PRIO((prio))]
 Transforms the priority to weight.
 
#define NICE_0_LOAD   GET_WEIGHT(DEFAULT_PRIO)
 Weight of a default priority.
 

Variables

static const int prio_to_weight [NICE_WIDTH]
 Table that transforms the priority into a weight, used for computing the virtual runtime. More...
 

Detailed Description

Defines processes priority value.

Variable Documentation

◆ prio_to_weight

const int prio_to_weight[NICE_WIDTH]
static
Initial value:
= {
88761, 71755, 56483, 46273, 36291,
29154, 23254, 18705, 14949, 11916,
9548, 7620, 6100, 4904, 3906,
3121, 2501, 1991, 1586, 1277,
1024, 820, 655, 526, 423,
335, 272, 215, 172, 137,
110, 87, 70, 56, 45,
36, 29, 23, 18, 15
}

Table that transforms the priority into a weight, used for computing the virtual runtime.