I’m not familiar with what this for loop is actually doing. Would anyone be able to explain? https://elixir.bootlin.com/linux/v5.10.75/source/kernel/sched/rt.c#L621 Answer This macro is setting rt_se to NULL after the instructions block that follows has been executed. The use of such “access” macro is common in the kernel to make the code more clear and robust.
Tag: scheduling
What’s the purpose of `on_rq` field in `task_struct`?
I am now reading the source code of try_to_wake_up() function of Linux Kernel. This function does a lot and includes this: return p->on_rq == TASK_ON_RQ_QUEUED. So, what is the actually purpose of on_rq field in task_struct. BTW, does there exist some manuals or reading materials to introduce all the fields in task_struct? I think a fully understanding of these fields
Who schedules threads?
I have a question about scheduling threads. on the one hand, I learned that threads are scheduled and treated as processes in Linux, meaning they get scheduled like any other process using the conventional methods. (for example, the Completely Fair Scheduler in linux) On the other hand, I also know that the CPU might also switch between threads using methods
Linux SCHED_OTHER, SCHED_FIFO and SCHED_RR – differences
Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR? Thanks Answer SCHED_FIFO and SCHED_RR are so called “real-time” policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don’t release the CPU). The difference between SCHED_FIFO and SCHED_RR is that
How Linux handles threads and process scheduling
I’m trying to understand how Linux handles process scheduling and thread scheduling. I read that Linux can schedule both processes and threads. Does Linux have a thread scheduler AND a process scheduler? If yes, how do they cooperate? Answer The Linux kernel scheduler is actually scheduling tasks, and these are either threads or (single-threaded) processes. So a task (a task_struct
Is it possible to “hang” a Linux box with a SCHED_FIFO process?
I want to have a real-time process take over my computer. 🙂 I’ve been playing a bit with this. I created a process which is essentially a while (1) (never blocks nor yields the processor) and used schedtool to run it with SCHED_FIFO policy (also tried chrt). However, the process was letting other processes run as well. Then someone told
How to instruct cron to execute a job every second week?
I would like to run a job through cron that will be executed every second Tuesday at given time of day. For every Tuesday is easy: But how to make it on “every second Tuesday” (or if you prefer – every second week)? I would not like to implement any logic in the script it self, but keep the definition