LKML Archive on
help / color / mirror / Atom feed
From: Dietmar Eggemann <>
To: Quentin Perret <>,
	Ingo Molnar <>,
	Peter Zijlstra <>,
	Juri Lelli <>,
	Vincent Guittot <>,
	Steven Rostedt <>,
	Ben Segall <>, Mel Gorman <>,
	Daniel Bristot de Oliveira <>,
Subject: Re: [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL tasks
Date: Thu, 29 Jul 2021 18:26:40 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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()
> 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
which surfaced when using `get_params()->__getparam_dl()` in
Just for reference, IIRC, you mentioned this already on irc.

Reviewed-by: Dietmar Eggemann <>


  reply	other threads:[~2021-07-29 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 10:11 [PATCH 0/2] A couple of sched_getattr() fixes for DL Quentin Perret
2021-07-27 10:11 ` [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL tasks Quentin Perret
2021-07-29 16:26   ` Dietmar Eggemann [this message]
2021-08-05  9:34   ` [tip: sched/core] " tip-bot2 for Quentin Perret
2021-07-27 10:11 ` [PATCH 2/2] sched: Don't report SCHED_FLAG_SUGOV in sched_getattr() Quentin Perret
2021-07-28  9:12   ` Juri Lelli
2021-07-28  9:39     ` Quentin Perret
2021-07-28 12:36       ` Juri Lelli
2021-07-29 17:21         ` Dietmar Eggemann
2021-07-29 17:28           ` Quentin Perret
2021-08-05  9:34   ` [tip: sched/core] " tip-bot2 for Quentin Perret

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL tasks' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).