[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230420173744.klscv7yli27uid6w@airbuntu>
Date: Thu, 20 Apr 2023 18:37:44 +0100
From: Qais Yousef <qyousef@...alina.io>
To: Saravana Kannan <saravanak@...gle.com>
Cc: Dietmar Eggemann <dietmar.eggemann@....com>,
David Dai <davidai@...gle.com>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Qais Yousef <qyousef@...gle.com>,
Quentin Perret <qperret@...gle.com>, kernel-team@...roid.com,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v1] sched/uclamp: Introduce
SCHED_FLAG_RESET_UCLAMP_ON_FORK flag
On 04/20/23 09:22, Saravana Kannan wrote:
> On Thu, Apr 20, 2023 at 2:37 AM Dietmar Eggemann
> <dietmar.eggemann@....com> wrote:
> >
> > On 20/04/2023 03:11, David Dai wrote:
> > > On Tue, Apr 18, 2023 at 10:18 PM Dietmar Eggemann
> > > <dietmar.eggemann@....com> wrote:
> > >>
> > >
> > > Hi Dietmar, thanks for your time,
> > >
> > >> On 16/04/2023 23:34, David Dai wrote:
> > >>> A userspace service may manage uclamp dynamically for individual tasks and
> > >>> a child task will unintentionally inherit a pesudo-random uclamp setting.
> > >>> This could result in the child task being stuck with a static uclamp value
> > >>
> > >> Could you explain this with a little bit more detail? Why isn't the
> > >> child task also managed by the userspace service?
> > >
> > > See Qais’ reply that contains more detail on how it’s being used in
> > > Android. In general, if a dynamic userspace service will adjust uclamp
> > > on the fly for a given task, but has no knowledge or control over if
> > > or when a task forks. Depending on the timing of the fork, a child
> > > task may inherit a very large or a small uclamp_min or uclamp_max
> > > value. The intent of this patch is to provide more flexibility to the
> > > uclamp APIs such that child tasks do not get stuck with a poor uclamp
> > > value when spawned while retaining other sched attributes. When
> > > RESET_ON_FORK is set on the parent task, it will reset uclamp values
> > > for the child but also reset other sched attributes as well.
> >
> > OK, in this case, why not just change behavior and always reset the
> > uclamp values at fork?
>
> Personally, I'd have preferred uclamp was never inherited in the first
> place, but wouldn't that be considered as breaking UAPI if we change
> it now?
Why is it okay to inherit priority but not uclamp? I see this is hacky and
setting a policy in the kernel. Let's not tailor it to specific use cases only
please.
--
Qais Yousef
Powered by blists - more mailing lists