lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL tasks
From
Date
On 27/07/2021 12:11, Quentin Perret wrote:
> It is possible for sched_getattr() to incorrectly report the state of
> the reset_on_fork flag when called on a deadline task.
>
> Indeed, if the flag was set on a deadline task using sched_setattr()
> with flags (SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS), then
> p->sched_reset_on_fork will be set, but __setscheduler() will bail out
> early, which means that the dl_se->flags will not get updated by
> __setscheduler_params()->__setparam_dl(). Consequently, if

True, but it would also be awkward if non-DL related flags would have to
be stored in dl_se->flags.

> sched_getattr() is then called on the task, __getparam_dl() will
> override kattr.sched_flags with the now out-of-date copy in dl_se->flags
> and report the stale value to userspace.
>
> To fix this, make sure to only copy the flags that are relevant to
> sched_deadline to and from the dl_se->flags field.

It also fixes the 'hidden' issue that a

uclampset -mX -MY -p dl_task

would end up at 'change:' label because of

dl_se->flags != attr->sched_flags

and not because of

attr->sched_flags & SCHED_FLAG_UTIL_CLAMP


And it also unblocks the uclamp-dl issue raised in
https://lkml.kernel.org/r/ad30be79-8fb2-023d-9936-01f7173164e4@arm.com
which surfaced when using `get_params()->__getparam_dl()` in
SYSCALL_DEFINE3(sched_setattr,...).
Just for reference, IIRC, you mentioned this already on irc.

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

[...]

\
 
 \ /
  Last update: 2021-07-29 18:27    [W:0.253 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site