linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Suren Baghdasaryan <surenb@google.com>
Cc: Patrick Bellasi <patrick.bellasi@arm.com>,
	Alessio Balsini <balsini@android.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Quentin Perret <quentin.perret@arm.com>,
	Joel Fernandes <joelaf@google.com>, Paul Turner <pjt@google.com>,
	Steve Muckle <smuckle@google.com>, Todd Kjos <tkjos@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Tejun Heo <tj@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	cgroups mailinglist <cgroups@vger.kernel.org>,
	linux-api@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v14 1/6] sched/core: uclamp: Extend CPU's cgroup controller
Date: Tue, 3 Sep 2019 10:52:48 +0200	[thread overview]
Message-ID: <20190903085248.GB8756@blackbody.suse.cz> (raw)
In-Reply-To: <CAJuCfpGWtrg02LNE3PJZag9-LLVT=by2v+9x_tm1PyoXwZ8DqQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On Mon, Sep 02, 2019 at 04:02:57PM -0700, Suren Baghdasaryan <surenb@google.com> wrote:
> > +static inline void cpu_uclamp_print(struct seq_file *sf,
> > +                                   enum uclamp_id clamp_id)
> > [...]
> > +       rcu_read_lock();
> > +       tg = css_tg(seq_css(sf));
> > +       util_clamp = tg->uclamp_req[clamp_id].value;
> > +       rcu_read_unlock();
> > +
> > +       if (util_clamp == SCHED_CAPACITY_SCALE) {
> > +               seq_puts(sf, "max\n");
> > +               return;
> > +       }
> > +
> > +       percent = tg->uclamp_pct[clamp_id];
> 
> You are taking RCU lock when accessing tg->uclamp_req but not when
> accessing tg->uclamp_pct.
Good point.

> Is that intentional? Can tg be destroyed under you?
Actually, the rcu_read{,un}lock should be unnecessary in the context of
the kernfs file op handler -- the tg/css won't go away as long as its
kernfs file is being worked with.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-09-03  8:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 13:28 [PATCH v14 0/6] Add utilization clamping support (CGroups API) Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 1/6] sched/core: uclamp: Extend CPU's cgroup controller Patrick Bellasi
2019-08-30  9:45   ` Peter Zijlstra
2019-09-02  6:38     ` Patrick Bellasi
2019-09-02  7:47       ` Peter Zijlstra
2019-09-02 23:02   ` Suren Baghdasaryan
2019-09-03  8:52     ` Michal Koutný [this message]
2019-09-03 14:21       ` Joel Fernandes
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: " tip-bot2 for Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 2/6] sched/core: uclamp: Propagate parent clamps Patrick Bellasi
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: " tip-bot2 for Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 3/6] sched/core: uclamp: Propagate system defaults to root group Patrick Bellasi
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: Propagate system defaults to the " tip-bot2 for Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 4/6] sched/core: uclamp: Use TG's clamps to restrict TASK's clamps Patrick Bellasi
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: " tip-bot2 for Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 5/6] sched/core: uclamp: Update CPU's refcount on TG's clamp changes Patrick Bellasi
2019-08-30  9:48   ` Peter Zijlstra
2019-09-02  6:44     ` Patrick Bellasi
2019-09-02  7:38       ` Peter Zijlstra
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: " tip-bot2 for Patrick Bellasi
2019-08-22 13:28 ` [PATCH v14 6/6] sched/core: uclamp: always use enum uclamp_id for clamp_id values Patrick Bellasi
2019-09-03  8:31   ` [tip: sched/core] sched/uclamp: Always use 'enum uclamp_id' " tip-bot2 for Patrick Bellasi

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=20190903085248.GB8756@blackbody.suse.cz \
    --to=mkoutny@suse.com \
    --cc=balsini@android.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=joelaf@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=quentin.perret@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=smuckle@google.com \
    --cc=surenb@google.com \
    --cc=tj@kernel.org \
    --cc=tkjos@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).