LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@redhat.com>
To: Quentin Perret <qperret@google.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v2] sched/deadline: Fix sched_getattr() for DL tasks
Date: Fri, 30 Jul 2021 11:22:18 +0200 [thread overview]
Message-ID: <YQPEygMj5ObRDLHG@localhost.localdomain> (raw)
In-Reply-To: <20210729175214.294142-1-qperret@google.com>
Hi,
On 29/07/21 18:52, Quentin Perret wrote:
> In its current state, sched_getattr() can report incorrect sched_flags
> if called on a deadline task.
>
> Firstly, if the reset_on_fork flag is set on a deadline task using
> sched_setattr() with SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS,
> p->sched_reset_on_fork will be set but __setscheduler() will bail out
> early without updating the dl_se->flags. Consequently, if sched_getattr
> is then called on the same task, __getparam_dl() will override
> kattr.sched_flags with the now out-of-date copy in dl_se->flags and
> report a stale reset_on_fork value to userspace.
>
> And secondly, sched_getattr() currently reports SCHED_FLAG_SUGOV as set
> if called on a schedutil worker, despite this flag being a kernel-only
> value that is not exposed in UAPI headers.
>
> To fix both of these problems, make sure to only copy the flags that are
> relevant to sched_deadline to dl_se->flags, and filter them out when
> reporting them back to userspace.
>
> Signed-off-by: Quentin Perret <qperret@google.com>
Looks good to me.
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Thanks!
Juri
prev parent reply other threads:[~2021-07-30 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 17:52 Quentin Perret
2021-07-30 9:22 ` Juri Lelli [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YQPEygMj5ObRDLHG@localhost.localdomain \
--to=juri.lelli@redhat.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--subject='Re: [PATCH v2] sched/deadline: Fix sched_getattr() for DL tasks' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).