Questions tagged [scheduling]

A technique for scheduling tasks to be run at a specific time or on a specific event.

75 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
2answers
2k views

Using and understanding systemd scheduling-related options in a desktop context

In systemd service files, one can set the following scheduling related options (from the systemd.exec man page, correct me if I'm wrong): Nice Sets the default nice level (scheduling ...
6
votes
0answers
4k views

Does the timeslice depend on process priority or not under Completely Fair Scheduling?

I'm trying to understand the Completely Fair Scheduler (CFS). According to Robert Love in Linux Kernel Development, 3rd edition(italics his, bold mine): Rather than assign each process a timeslice,...
5
votes
0answers
340 views

Limiting per process dirty bytes without slowing down the whole system

Given a busy system with a really fast block device (highend NVMe raid, 2 GB/s write, 4 GB/s read) mounted at /data and an a really slow device (USB HDD with spinning 8 TB disk, 50 MB/s write, 60 MB/s ...
4
votes
2answers
907 views

How does the Linux scheduler determine if a process is I/O bound or CPU bound

Adding to this question, how does the scheduler determine if a process is I/O bound or CPU bound? Mr. Love in this article, says "schedulers often employ complex algorithms to determine the most ...
3
votes
0answers
349 views

ext4 jbd2 and I/O priority

I want to delete a huge directory with over 6 million files across over 4000 directories, totaling about 26GB of data. As I knew this was going to take a while I used ionice to set the I/O priority ...
3
votes
0answers
51 views

What is the maximum processor frequency that Linux could run on?

Theoretically, if an extremely fast computer could be built (100s of GHz or even terahertz), what is the maximum frequency that could be expressed in the variable used by the scheduler allocate cycles?...
3
votes
1answer
425 views

Zsh clear command line from zsh/sched call

I try the following: clear-cmdline() { zle && zle kill-buffer sched +3 clear-cmdline } sched +3 clear-cmdline After I run this code, I enter a few letters at prompt, and wait. ...
3
votes
1answer
834 views

Job queueing on a single machine

I have a shiny new server for running simulations on, with a pair of Tesla GPUs and 32 cores, running CentOS 7.2. I'd like for multiple users to be able to submit jobs to the server that get queued up ...
3
votes
0answers
493 views

System time in Minix with best precision

I'm working on a project to modify the scheduler in MINIX 3. So to test it I need to analyse the wait time and turnaround time. To calculate the wait time I'm storing the system time when the process ...
3
votes
1answer
575 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
2
votes
0answers
23 views

Linux task state different in /proc/pid/stat compared to Ftrace output of sched events

I'm trying to trace the flow of a piece of code just to understand the points where the tasks go into D/S/R states (uninterruptible/interruptible/running). I do understand the meaning of each state, ...
2
votes
1answer
41 views

How does the kernel assign the nice value to a process after it has been executed?

The Linux kernel implements two separate priority ranges. The first is the nice value, a number from –20 to +19 with a default of 0. Nice values are the standard priority range used in all Unix ...
2
votes
0answers
32 views

Incorrect Top? or manpage?

According to top's manpage: 16. PR -- Priority The scheduling priority of the task. If you see `rt' in this field, it means the task is running under real time scheduling priority. ...
2
votes
0answers
328 views

Shielding CPU from scheduler - How to move bound kernel threads from cores?

Suppose I have 4 physical cores (indexed 0-3) and I'm dedicating cores 1-3 to a shield for user applications and trying to steer all system threads onto core 0. I'm following the answers here and ...
2
votes
0answers
545 views

How does Linux CFS schedule processes vs threads fairly in 2018 4.9 kernels?

The Linux scheduler keeps evolving: How does the kernel schedule processes vs threads today? Do I need autogroups? The previous similiar stack overflow question is many years old and likely obsolete. ...
2
votes
0answers
32 views

May a process be assigned to another CPU before terminated?

I'm trying to monitor the action of CPU, and I've found something interesting. First I have a script named task.sh as below: #!/bin/sh for i in {1..999}; do sleep 2 echo $$ Then I execute ....
2
votes
0answers
310 views

Hyper Threading and Process Priority

Are there any methods (linux kernel options, sysctl settings or configurable scheduler modules) that can cause a high priority process/thread to run on a physical processor core with the second (hyper ...
2
votes
1answer
114 views

Creating a timelapse with guvcview

Is there a way to create a timelapse video (or similar) with guvcview? I'm using an external (USB) camera and ordinary footage seems to very quickly fill a hard drive. Can I get it to record an ...
2
votes
1answer
352 views

Change Ubuntu 1604 IO scheduler on AWS?

I am using a VM from AWS, Ubuntu 1604. The tricky thing is that I am not able to change the block device's IO scheduler in this way: root@ip-10-0-96-236:/home/ubuntu# cat /sys/block/xvdb/queue/...
2
votes
0answers
188 views

Running a process in a specified time window

Large computational tasks consume time and computational resources, therefore I am looking for a way to execute them in a specified time window using a shell script. I want to run the script batch.sh ...
2
votes
1answer
264 views

Is “top” accounting for Kernel Interrupts?

I have a simple interrupt that is triggered by a GPIO-input. The IRQ only increments a variable and returns. When I turn the frequency of the interrupts up to somewhere around 10-20 kHz, the system ...
2
votes
0answers
1k views

Catch the kill signal when a process is in S state [interruptible sleep]

This is the process group : (ps -ejH) xxxx xxxx xxxx ? 00:00:00 sshd yyyy yyyy yyyy ? 00:00:00 sshd 8713 8713 8713 pts/0 00:00:00 bash 1234 1234 1234 ? ...
2
votes
0answers
931 views

What is the minimum round robin scheduing interval supported by Linux?

For some reason, I want to have 10 processes share the same CPU core by affinity. As you know, to achieve CPU sharing between processes, we can exploit the Linux round robin (RR) scheduling policy. ...
2
votes
0answers
989 views

how to stop kernel threads preempting real time user space processes?

I created some processes in user space and tried to visualize its working in kernelshark with the trace recorded using trace-cmd. But kernel processes like the ones shown below are preempting my ...
2
votes
1answer
523 views

Run command after nice command has finished

I have 3 nice commands that are dumping some databases, and compress assets for a backup. After that, the files should be copied to another server. I'm using this command: nice mysqldump -u user1 -p'...
2
votes
0answers
309 views

So the design of client-server separation is not the bottleneck of X Window?

In the answer of this, it mentioned: People also hear that X uses the "network" and think this is going to be a performance bottleneck. "Network" here means local UNIX domain socket, which has ...
1
vote
0answers
22 views

Deterministic thread cancelation

Is there a way to deterministicly cancel threads (Light-weight process) in linux. Let say I want to cancel a thread because it is possible in an infinite loop or my scheduler requires it. How would ...
1
vote
0answers
9 views

VRUNTIME variable maximum value in minutes / hours (CFS Scheduler)

VRUNTIME is described as the variable in the sched_entity structure that tracks time (nanoseconds). is this a 64 bit value ? If so what is the maximum time in minutes / hours this variable can hold. ...
1
vote
0answers
175 views

How to set the SCHED_RR time slice or time quantum per process / thread?

The time slice (also called time quantum) for threads with SCHED_RR policy can, according to the sched_rr_get_interval man page be obtained using int sched_rr_get_interval(pid_t pid, struct timespec *...
1
vote
1answer
103 views

Realtime, SCHED_FIFO, CPU_SET()

I'm trying to assign two real time processes to two cpus(one each). I'm using SCHED_FIFO scheduling policy. I'm doing the following things: adding "quiet splash isolcpus = 6,7" at ...
1
vote
2answers
76 views

Slurm like alternative for localhost

I have resources (e.g. GPU) I can only use once at a time. When performing experiments I always need to know on time of a batch files creation, what experiments I want to execute in the future. But I ...
1
vote
0answers
26 views

Determine average and maximum execution time of a task by using ftrace/perf

I've gathered some traces containing scheduling events ('sched:*') by using ftrace and perf record. By analyzing the results many of my questions could already be answered. However, I was wondering ...
1
vote
0answers
152 views

How to keep Linux kworker threads alive?

I'm experiencing some data loss on a USB-to-serial adapter on a Raspberry Pi running at a (relatively) high data rate. I believe most of the work is carried out by kernel threads: 2569 root 20 ...
1
vote
0answers
75 views

Linux (kernel 3.x and 4.x) Pthread and general process scheduling algorithms

I was wondering if both scheduling (contention) scopes (SYSTEM and PROCESS) are used in the Linux kernel scheduling logic. POSIX supports PROCESS scope pthreads (MXN model) and SYSTEM scope pthreads (...
1
vote
0answers
42 views

During what kinds of operations is a process considered for the 'load average'?

In general, I'm trying to understand the numbers displayed by uptime (and numerous oder commands): $ uptime 13:40:52 up 18 days, 2:10, 8 users, load average: 0.20, 0.30, 0.64 Here, my system's ...
1
vote
1answer
88 views

Why will crontab not run my file at a set time, but will run every minute?

So, I have attempted to get crontab to run a node.js file at a set time everyday. I have set it up by doing crontab -e. I have tested that it runs every minute by using the below: * * * * * //path of ...
1
vote
0answers
39 views

Difference between se->cfs_rq->tg and task_of(se)->sched_task_group

Are they different by definition? What are their advantages?
1
vote
0answers
63 views

Automatic nice value?

I noticed that a process - here sort - has been scheduled with a higher nice value (2) - meaning lower priority. But what is the policy for deciding that? Also, it seems to be a rare event, as all ...
1
vote
0answers
2k views

Crontab in Mac is not working

I'm trying to automate a python job using crontab in mac. It's not running on the cron however it's working when run manually & have given full permission to the scripts. As a test, did a echo ...
1
vote
0answers
307 views

Linux / CFS: How do cgroupsv1 cpu.share / cgroupsv2 cpu.weight and nice process weights interact

I was wondering how cgroup cpu shares/weights (v1: cpu.shares or v2: cpu.weight) and the niceness value of a task do interact in Linux with the CFS (Completely Fair Scheduler). Both values have an ...
1
vote
0answers
227 views

Does it make sense to combine chrt and nice?

I want a CPU-intensive process to have the lowest possible impact on other processes. I can use nice -19 for maximum niceness and chrt -i 0 to give the process a SCHED_IDLE priority. Which is more ...
1
vote
1answer
44 views

Daily Cron for a month in Debian

How to make a Daily Cron only for a month? I want to run a certain command everyday at 2PM but want to run It only for a month, and after the month it should stop on its own. How to make it?
1
vote
0answers
131 views

Concurrent guest vcpu operation on KVM

I am launching an x86 debian system as guest using QEMU2.6.0 on my x86 host machine. The host is an 8-core, 2-socket machine booted with RHEL7 with KVM enabled. 2 PCI devices are being emulated on ...
1
vote
0answers
178 views

Using cgroups to write a job scheduler

One problem with cron is that if there are more jobs that can reasonably be run at a certain time, cron doesn't care: it will happily spawn the jobs anyway resulting in poor performance for all of ...
1
vote
0answers
493 views

Set GRUB `elevator=deadline` scheduling to a single device

I'd like to set my secondary drive to deadline. Is it possible to do it via GRUB, but leaving the primary drive as cfq? A script after booting would suffice in my case, but I'm interested in the GRUB ...
1
vote
0answers
713 views

Round Robin vs FIFO

recently I had to do some reports about scheduling processes in Linux, and to do so, we were asked to turn off all cpu except 0 to show how processes are running for cpu. But there is one thing which ...
1
vote
0answers
294 views

Process scheduling and core allocation on big.LITTLE CPUs

Recent ARM chips, like the Qualcomm Snapdragon 810, seem to be using a hybrid architecture called "big.LITTLE" with cores of different architectures and speeds combined into one CPU. On a Linux (or ...
1
vote
0answers
590 views

How to set a process’s sched method to fifo and priority when cgroup are on?

I’m using CentOS 6.6, I want to set the sched method of my kvm VM to FIFO with priority 1. First, I use chrt and get error: chrt(): "failed to set pid XXX's policy" I find here: chrt(): "...
1
vote
0answers
44 views

expanding the priorities table in runqueue in Linux kernel

I have a hw assignment that I'm having really hard time with, probably since I'm new to the whole Linux kernel thing. we're supposed to add a new scheduling policy to the existing scheduling ...
1
vote
0answers
47 views

Spawning processes on a job stack

I have a hobbyist server on which I want users to upload a file, and then receive the overcome of some processing (server-side) over the given file. I am doing the processing synchronously so that for ...