Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1686170ybe; Tue, 3 Sep 2019 01:54:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0iD5o0P0US09vv3L/Z+rqde032tkFf8zYMHo3YYOZaQwvJholWgaVKPT9sJrhUFOuWYuo X-Received: by 2002:a17:902:748b:: with SMTP id h11mr32795329pll.269.1567500849266; Tue, 03 Sep 2019 01:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567500849; cv=none; d=google.com; s=arc-20160816; b=Zmzl4XmdeNhhb1tkM6IaKFNVx/rjaREXIYQuPoaAeHAek51ziGbAlf4byPTWrrV8Uz yVFTHc/6ccvD+GnqRRXrFDVQS1K42/LQXI/VeyQ9Q7XHDyVjvH0EW4iF6s6EYK560Zuv IuB1Pxz/dSTGrhvHxCePcxIE4sUpp4mnqST/WdvTGO5tSxKwYpokvTqL26vRRQr2mRc2 U/uccsNknssqcRiObtgqrhnCs3mqBYOQN5xaefxKHgVYqDYTwsUOOg75HCnr0no1iBYm vorSymmI8FSx4hiGcL+COVP5McJDvAfV0EkN2FzD6x3+hU2fMp1RkdC8NCOis9SOxmch PQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kGtcUFDZNsq2696ecgIIl5pUl4pwF2xAK3O4ax1612M=; b=gPaFEoOoyy8cJp3zpjPdtuNr4WdgYvDy0YOc/n+I+MdcWz7tFyJ5GPUPA+tS+aDJZY azQ0HQG0ZlOqNyeWi219yIYf7MPY8YO06HCVbTPP6gZXeRFHyOSt8NLQlL5f5KnW4Gib jxAaJveANJ0zJRQCtF5s5O3tjpIgj62ndnVFDMOpmSeJT9kEamjuKtvIHKH6lXiWjIec gLrISepR8q6jODnp8q4fenCkDdTunbS7hMHiKJ62BhuZlfkkNJS+KULlyi8QFFxeP5Dq DwHY7Le+6hc1nK/9TwRy9fkCLqbxcvmb6Iz+tp09+YT+lAwDHRAYeG/UZyw8mdx/1jWZ DClQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cj19si14373869plb.72.2019.09.03.01.53.53; Tue, 03 Sep 2019 01:54:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728221AbfICIw7 (ORCPT + 99 others); Tue, 3 Sep 2019 04:52:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:51498 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726557AbfICIw7 (ORCPT ); Tue, 3 Sep 2019 04:52:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3AF34B807; Tue, 3 Sep 2019 08:52:57 +0000 (UTC) Date: Tue, 3 Sep 2019 10:52:48 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Suren Baghdasaryan Cc: Patrick Bellasi , Alessio Balsini , Dietmar Eggemann , Morten Rasmussen , Quentin Perret , Joel Fernandes , Paul Turner , Steve Muckle , Todd Kjos , Peter Zijlstra , "Rafael J . Wysocki" , Tejun Heo , Vincent Guittot , Viresh Kumar , Juri Lelli , Ingo Molnar , cgroups mailinglist , linux-api@vger.kernel.org, LKML , linux-pm@vger.kernel.org Subject: Re: [PATCH v14 1/6] sched/core: uclamp: Extend CPU's cgroup controller Message-ID: <20190903085248.GB8756@blackbody.suse.cz> References: <20190822132811.31294-1-patrick.bellasi@arm.com> <20190822132811.31294-2-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 02, 2019 at 04:02:57PM -0700, Suren Baghdasaryan wrote: > > +static inline void cpu_uclamp_print(struct seq_file *sf, > > + enum uclamp_id clamp_id) > > [...] > > + rcu_read_lock(); > > + tg =3D css_tg(seq_css(sf)); > > + util_clamp =3D tg->uclamp_req[clamp_id].value; > > + rcu_read_unlock(); > > + > > + if (util_clamp =3D=3D SCHED_CAPACITY_SCALE) { > > + seq_puts(sf, "max\n"); > > + return; > > + } > > + > > + percent =3D tg->uclamp_pct[clamp_id]; >=20 > 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. --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl1uKdYACgkQia1+riC5 qSjfnQ/7BeUT18FFFi99Yyw3HCELlyDCFeWq85E5tsiLPEIlUV0DWFe5st1TugIz RUQBMlHdM4UsgbRX8J//envlsT6aFD4ZMNp9LdYAK/PUMo8b68B63vsBBNLVfCNm ayv6/oowRNcbo4c3NQ2V5eiIt/X8V4JWQHRr4IpM+U6DwmWBQ9hpsKH7yXlcHYQv px/as6LKBxDtpURI4SUTm8sva7roOi1uixZ25BwPurRDisZlY990IGClMtOsW3S8 Ik59LppHO1YHee5B+ifFdPvmqvv3QdJVOjQBL050MdLPS6advmVSvmt/GRSr1MAa kj7c8reeTo1jlHO9YmT2qqt+vsxfYMJxudnujXnQ5FZI60ibhSbLclDiEsc8028r HpNJFNFkTZiURjJd39wJr3zSuXoFafIkc24s4QYDywHoSajloMc9xrqUTv3z+pdW fhSdekB+3paS04Hesmnr4rV6a6Uo6hYatSEADG3XFbIv5TEBLOXK6bYv/KMKLj8X 98U43Ude0YmGi/B3HH6UYJFbXqrU5kBhlD/3S/RwF/NBhwPJM8bSZmzVJhWvXVDw 0DAcrfxiexS7Pp4kG2BFXlUGyTkN+2DRi+3ymiSW4y2+5DuYDvStFBw7Ud7eQZzN YkkBGQzTAmUzb0wpHOHhQ3diiq914WViZpwSuxVZ7FNaJgdGe3s= =B4jM -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4--