Questions tagged [scheduling]

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

122 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
1k 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 ...
elleciel's user avatar
  • 465
5 votes
0 answers
1k 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 ...
Till Schäfer's user avatar
5 votes
0 answers
761 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 ...
Mikko Rantalainen's user avatar
5 votes
2 answers
2k 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 ...
Yoshanuikabundi's user avatar
3 votes
0 answers
1k views

cgroups v2 cpuset doesn't take an effect without process restart

I'm trying to isolate some CPU cores for latency-sensitive processes using the cpuset controller in cgroup v2. I created a group lowlatency: mkdir /sys/fs/cgroup/lowlatency and restricted it to use ...
Maxpain's user avatar
  • 31
3 votes
0 answers
208 views

How do I flag a process to avoid hyperthreading (SMT)?

Suppose I have an 18 core CPU with SMT enabled, and there are 18 long runnning processes, all using ~100% of a thread. If I start a 19th process, the kernel will schedule it to run on one of the cores,...
uLoop's user avatar
  • 141
3 votes
0 answers
414 views

systemd niceness and scheduling configurations not effective in processes performance

My team inherited the care and maintenance of code for a service that runs three python scripts and creates processes which play a part in sending data from our product to another product. One process ...
Lotusmeristem's user avatar
3 votes
0 answers
5k 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 ...
Holmes's user avatar
  • 131
3 votes
0 answers
630 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 ...
Python Jhon's user avatar
3 votes
1 answer
1k 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. ...
camria's user avatar
  • 31
2 votes
1 answer
169 views

How to make a process occupy one CPU completely?

I am working on an embedded Linux system (kernel-5.10.24). I am trying to make a process to occupy one CPU completely without being scheduled out. #define _GNU_SOURCE #include <sched.h> #include ...
wangt13's user avatar
  • 429
2 votes
1 answer
527 views

How does round-robin scheduling and context switching work from a low-level?

Using round-robin scheduling, the kernel provides time slices for different processes / tasks. It seems that the kernel will initialize a timer, and when the timer times out, this will cause the ...
Engineer999's user avatar
  • 1,151
2 votes
0 answers
413 views

How to stop the kernel from pausing my thread?

I have written a software PWM generator for the raspberry PI 4 (Debian Bullseye, kernel 5.10.92). It is a multi-threaded program and one thread is the PWM generator. It is supposed to run ...
chmike's user avatar
  • 211
2 votes
0 answers
81 views

Placing the entire Xserver and GUI inside a cgroup/slice?

With the intent to guarantee a minimum amount of cpu cycles to keep the desktop environment smooth and snappy, Questions: Is it doable? Would this be a good idea? How would you go about doing this? ...
k4my4b's user avatar
  • 21
2 votes
1 answer
872 views

Delay/offset crontab */x scheduling by a certain amount of time

I'm running a script every 4 days with 0 */96 * * * /path/to/script.sh However I want to offset this such that I can run a second script every 4 days, but spaced apart from the first script by 2 ...
James Palmer's user avatar
2 votes
0 answers
801 views

Is pulseaudio's default nice value (-11) actually ineffective due to autogroup?

The pulseaudio daemon runs with nice level -11 by default, via rtkit. However, I'm noticing choppy audio at times of high cpu load, and decreasing the nice value even further by setting high-priority ...
Marc.2377's user avatar
  • 1,112
2 votes
0 answers
231 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, ...
mdaniel's user avatar
  • 141
2 votes
0 answers
48 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. ...
HCSF's user avatar
  • 213
2 votes
0 answers
69 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?...
spacehitchhiker42's user avatar
2 votes
0 answers
48 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 ....
Yves's user avatar
  • 3,291
2 votes
0 answers
718 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 ...
kontextify's user avatar
2 votes
1 answer
271 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 ...
voices's user avatar
  • 1,272
2 votes
1 answer
454 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/...
Howard Shane's user avatar
2 votes
0 answers
281 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 ...
Peter Gerhat's user avatar
  • 1,212
2 votes
0 answers
2k 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 ? ...
Langdon's user avatar
  • 21
2 votes
0 answers
1k 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. ...
cheng's user avatar
  • 21
2 votes
0 answers
1k 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 ...
sagittarius's user avatar
2 votes
0 answers
397 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 ...
Justin's user avatar
  • 713
1 vote
0 answers
19 views

Latency on pselect caused by other user space processes

I have the following pre-condition on Linux: I'm using a process to read serial data using pselect on a serial device /dev/ttySX. Data comes in at a stable frequency of 400 Hz. To optimize latency of ...
nyquist's user avatar
  • 11
1 vote
1 answer
82 views

This cron script was missed by shutdown

Is there a way to setup cron (or any other scheduler, like anacron) to run such that it checks immediately after I resume working on my laptop (e.g. after suspension or shutdown) whether it has ...
user7088941's user avatar
1 vote
1 answer
506 views

chrt fails to set policy - Invalid argument

This happens both on Fedora and Garuda. Here are example error messages: $ sysctl kernel/sched_deadline_period_min_us kernel/sched_rt_period_us kernel/sched_rt_runtime_us kernel....
adamski234's user avatar
1 vote
1 answer
809 views

Linux kernel BUG: scheduling while atomic: swapper/0/0/0x7fff0001

I'm running Arch Linux, kernel 5.17.3 (though this issue has been happening across many versions.) Every couple of days, I get random complete system freezes. The kernel logs vary, but they most ...
Keegan Conlee's user avatar
1 vote
0 answers
75 views

How does Completely Fair Scheduling handle new Processes

I'm currently trying to understand Completely Fair Scheduling (CFS) and stumbled across something I can't understand. Let's make an example: I have a process running in the background (for example ...
Philipp Bleimund's user avatar
1 vote
0 answers
208 views

Scheduling difference manual execution vs Slurm srun/sbatch

tl;dr A CPU intensive workload ignores the nice values of other processes only when started via Slurm sbatch/srun (not when manually started). I am running a systemd service which periodically gathers ...
ntippman's user avatar
1 vote
1 answer
645 views

Linux equivalent of Thread Director?

The 12th Generation Intel chips are rumoured to have "Efficient" and "Performance" cores. Apparently Microsoft's Thread Director, in Windows 11, takes advantage of them. What will ...
power's user avatar
  • 111
1 vote
0 answers
38 views

Does the Linux Genreic Block Layer prefer Read requests over Write Requests?

Does the Generic Block Layer in the Linux kernel, prioritize read requests over write requests ? That is without taking the I/O scheduler into account.
nishad kamdar's user avatar
1 vote
1 answer
1k views

Does uninterruptible tasks consume CPU time?

Assumption My assumption is what I myself consider fact based on my understanding: Tasks in either TASK_INTERRUPTIBLE and TASK_UNINTERRUPTIBLE state are not "runnable". As such, they are ...
Tran Triet's user avatar
1 vote
0 answers
47 views

Can a mprotect() call lead to priority inheritance in Linux scheduling?

Is it possible, that a call of mprotect() in Linux can lead to priority inheritance? When analyzing an ftrace file, I see a call of mprotect() by Task 1 followed by a priority inheritance. Task 2 gets ...
Iniesta8's user avatar
  • 121
1 vote
0 answers
46 views

Limit processor time of individual processes

We have a shared system/cpu for many students at our university. Everyone can launch processes and there limits on how much processing power a user can take. This works rather well except for some ...
Valentin Metz's user avatar
1 vote
0 answers
715 views

Systemd transient timer created with systemd-run is not shown in listed units

Some time ago, I created a systemd timer using the command: systemd-run --on-calendar='*-*-01 12:00:00' --description='Update root hints for unbound' --property='After=network.target' --timer-...
smac89's user avatar
  • 1,433
1 vote
0 answers
775 views

ps command output, WCHAN column '-' for all processes

ps axo ppid,pid,stat,wchan,cmd outputs - for the WCHAN column for all processes, including the ones in sleep, on Debian bullseye, did I do something wrong? BTW, wchan shows 'the kernel function in ...
QnA's user avatar
  • 545
1 vote
2 answers
258 views

How can I prevent repeated malloc from slowing down system to a halt before the program is killed with SIGKILL?

Obviously I don't typically run: #include <stdlib.h> int main() { while (malloc(50)); return 0; } But I have been attempting to compile large projects. When running cmake, my computer'...
finks's user avatar
  • 111
1 vote
0 answers
78 views

Is there a Cache Scheduler?

I am trying to understand how Schedulers work in Linux. I am aware that there is an I/O scheduler and CPU scheduler in Linux. My question is how does Last Level Cache scheduling work? Is there any ...
Abhinav's user avatar
  • 11
1 vote
0 answers
92 views

In which context the linux block device driver request runs?

Finally, the invocation of the request function is (usually) entirely asynchronous with respect to the actions of any user-space process. You cannot assume that the kernel is running in the ...
Karthik Nedunchezhiyan's user avatar
1 vote
0 answers
237 views

How does the SCHED_DEADLINE runtime overrun signal (SIGXCPU) work?

I'm implementing a rt-thread using SCHED_DEADLINE. I'm trying to catch a SIGXCPU-signal, if the thread exceeds the specified sched_runtime. To my understanding of the manpage, this can be achived by ...
rkl's user avatar
  • 11
1 vote
0 answers
268 views

What is the meaning of <idle>-0 in kernel debug tracing?

Recently when I tried to do some kernel driver debugging in Ubuntu 16.04, kernel version 4.15, I come across the kernel tracing mechanism, which is pretty handy to observe all kinds of kernel ...
lordofire's user avatar
1 vote
0 answers
39 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 ...
Marko Bencik's user avatar
1 vote
0 answers
103 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. ...
Cerezo's user avatar
  • 171
1 vote
1 answer
667 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 ...
Venu Aditya's user avatar
1 vote
0 answers
122 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 ...
Iniesta8's user avatar
  • 121