Right... Now that you point this out, I realize that dl_se->dl_throttled = 0Well, in my understanding if I change the parameters of aBased on your comments, I suspect my patch can be further
simplified by moving the call to init_dl_task_timer() in
__sched_fork().
It seems this way has problems. The first one is that task may become
throttled again, and we will start dl_timer again.
SCHED_DEADLINE task when it is throttled, it stays throttled... So, the
task might not become throttled again before the dl timer fires.
So, I hoped this problem does not exist. But I might be wrong.
You keep zeroing of dl_se->dl_throttled
and further enqueue_task() places it on the dl_rq.I was under the impression that no further enqueue_task() will happen (since
You are right, my fault.The second is thatYes, this was my goal too... So, if I change the parameters of a task
it's better to minimize number of combination of situations we have.
Let's keep only one combination: timer is set <-> task is throttled.
when it is throttled, I leave dl_throttled set to 1 and I leave the
timer active.
As I see,
dl_se->dl_throttled = 0;
is still in __setparam_dl() after your patch, so you do not leave
it set to 1.
I know... But the final goal is to allow non-root users to use SCHED_DEADLINE,I think that when people change task's parameters, they want theI see... Different people have different requirements :)
kernel reacts on this immediately. For example, you want to kill
throttled deadline task. You change parameters, but nothing happens.
I think all developers had this use case when they were debugging
deadline class.
My goal was to do something like adaptive scheduling (or scheduling
tasks with mode changes), so I did not want that changing the
scheduling parameters of a task affected the scheduling of the other
tasks... But if a task exits the throttled state when I change its
parameters, it might consume much more than the reserved CPU time.
Also, I suspect this kind of approach can be exploited by malicious
users: if I create a task with runtime 30ms and period 100ms, and I
change its scheduling parameters (to runtime=29ms and back) frequently
enough, I can consume much more than 30% of the CPU time...
Anyway, I am fine with every patch that fixes the bug :)
Deadline class requires root privileges. So, I do not see a problem
here. Please, see __sched_setscheduler().
If in the future we allow non-privileged users to increase deadline,Ok.
we will reflect that in __setparam_dl() too.