我很难理解setscheduler函数中的sched_priority角色。
我使用的是linux 2.4.X,文档中写道:
Valid priorities for SCHED_OTHER is 0, Valid priorities for SCHED_RR\FIFO are 1...MAX_USER_RT_PRIO-1
但是,我记得rt进程的优先级是0-99,SCHED_OTHER的优先级是100-139,所以...我错过了什么?struct sched_param中的sched_priority指的是什么?
是否有一种方法可以使用截止日期调度,同时将cpu关联设置为linux中的进程?我正在运行4.16内核。下面是我的测试代码:
#define _GNU_SOURCE
#include "include/my_sched.h"
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
int main() {
struct sched_attr attr;
int x = 0;
int ret;
unsigned int flags = 0;
l
我有4 CPU的linux服务器。我安装了mysql,并且在后台运行24/7运行CPU繁重的任务。我对每个进程使用CPU关联有什么好处吗?例如:
1 CPU = background task/daemon
2 CPU = background task/daemon
3 CPU = background task/daemon
4 CPU = mysql
每个后台任务在任何给定的时间消耗多达80%的CPU。
更新:我的任务是lxml解析器(python)。