Comments (7)
performs the admittance test only once when a task is changed to deadline class
Also when parameters are changed. And when cpuset masks change as well (e.g., a check is performed to see if shrinking a cpumask down still leaves enough bandwidth for already admitted tasks).
You are right that the only interface we have at the moment to deal with affinities is using cpusets.
Admission control (and affinity checks) can however be disabled by writing -1 in sched_rt_runtime_us.
from rt-app.
Is it possible to reset the "cpus_allowed" for every thread ( in the code of "cpus" ) ?
from rt-app.
hi z-linlinlin,
As you mentioned above, we can't restrict cpus allowed for deadline scheduler so it's up to the writer of the json file use case to ensure that this will not happen.
as default cpumask is all cpus and we can set affinity per phase with a fall back to this default mask when not mentioned, you should be able to ensure that all cpus are allowed when setting deadline scheduling mode
from rt-app.
IIUC, deadline performs the admittance test only once when a task is changed to deadline class, which means we can't be changing affinity after thread creation. However I think it should be possible to use cpusets to restrict deadline tasks so long as you don't go changing them after creation - but you would need to add better cgroup support to rt-app first. See #49
From the deadline docs in-kernel:
- Tasks CPU affinity
=====================
-deadline tasks cannot have an affinity mask smaller that the entire
root_domain they are created on. However, affinities can be specified
through the cpuset facility (Documentation/cgroup-v1/cpusets.txt).
5.1 SCHED_DEADLINE and cpusets HOWTO
An example of a simple configuration (pin a -deadline task to CPU0)
follows (rt-app is used to create a -deadline task).
mkdir /dev/cpuset
mount -t cgroup -o cpuset cpuset /dev/cpuset
cd /dev/cpuset
mkdir cpu0
echo 0 > cpu0/cpuset.cpus
echo 0 > cpu0/cpuset.mems
echo 1 > cpuset.cpu_exclusive
echo 0 > cpuset.sched_load_balance
echo 1 > cpu0/cpuset.cpu_exclusive
echo 1 > cpu0/cpuset.mem_exclusive
echo $$ > cpu0/tasks
rt-app -t 100000:10000:d:0 -D5 (it is now actually superfluous to specify
task affinity)
from rt-app.
I'm trying to run a deadline taskset into a cpuset made with 2 cores. The taskset is the following:
{
"tasks": {
"task4": {
"runtime": 47000,
"timer": {
"period": 1000000,
"mode": "absolute",
"ref": "unique"
}
},
"task3": {
"runtime": 57000,
"timer": {
"period": 1000000,
"mode": "absolute",
"ref": "unique"
}
},
"task2": {
"runtime": 26000,
"timer": {
"period": 1000000,
"mode": "absolute",
"ref": "unique"
}
},
"task0": {
"runtime": 411000,
"timer": {
"period": 1000000,
"mode": "absolute",
"ref": "unique"
}
},
"task1": {
"runtime": 208000,
"timer": {
"period": 1000000,
"mode": "absolute",
"ref": "unique"
}
}
},
"global": {
"duration": 2,
"default_policy": "SCHED_DEADLINE",
"pi_enabled": false,
"lock_pages": false,
"logdir": "./rtapp-log",
"log_basename": "rt-app",
"log_mode": "file",
"gnuplot": false
}
}
I create the cpuset as said before by @credp, the only difference is echo 2-3 > mycpuset/cpuset.cpus
. Once I try to execute the taskset with ./rt-app Config.json
i get the following error:
[rt-app] <crit> [0] sched_setattr returned -1
sched_setattr: failed to set deadline attributes: Device or resource busy
The same taskset into a different terminal works as expected. What am I doing wrong?
EDIT:
I just find out something strange. In short it works with N tasks with N <= cpus in /dev/cpuset/mycpuset/cpuset.cpus
.
So if there is only one cpu in the cpuset it does not work. If I use, for example, 2-3 cpus in cpuset.cpus the first -deadline task starts correctly and I get sched_setattr: failed to set deadline attributes: Device or resource busy
for all left tasks. Finally if I use 0-2 as cpus for the cpuset I'm able to start the first and the second tasks but getting the error mentioned above for all other tasks.
from rt-app.
So, is this fixed/not a bug as per discussion happening at #101 ?
from rt-app.
Yes, I think so.
from rt-app.
Related Issues (20)
- Python 3 compatibility HOT 2
- Create hackbench workload with rt-app
- Print in the log file the core used HOT 1
- broken examples HOT 2
- impossible to reset uclamp
- Change in uclamp fails if not accompanied by policy
- uclamp and taskgroup mix issue
- Asymmetrical treatment of "priority" and "policy"
- error with ftrace examples HOT 1
- This isn't an issue rather a question HOT 2
- usage: rt-app <taskset.json> HOT 4
- continue_running confused someone, signal handler behaviour is undefined HOT 7
- sequence of 'phases' object in rt-app config is undefined - should use an array instead? HOT 5
- Looks like this question is still valid and unanswered. :-)
- Merge GRUB reclaiming
- RTapp fails to run with the right runtime when given a float
- mlockall always applied by default without graceful failure
- rt-app ignores invalid task names
- rtapp execution gives unreliable actual duty cycle HOT 21
- generated gnuplot plot file is wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rt-app.