From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbdCMKqZ (ORCPT ); Mon, 13 Mar 2017 06:46:25 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36197 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbdCMKqP (ORCPT ); Mon, 13 Mar 2017 06:46:15 -0400 MIME-Version: 1.0 In-Reply-To: <1488292722-19410-2-git-send-email-patrick.bellasi@arm.com> References: <1488292722-19410-1-git-send-email-patrick.bellasi@arm.com> <1488292722-19410-2-git-send-email-patrick.bellasi@arm.com> From: "Joel Fernandes (Google)" Date: Mon, 13 Mar 2017 03:46:13 -0700 Message-ID: Subject: Re: [RFC v3 1/5] sched/core: add capacity constraints to CPU controller To: Patrick Bellasi Cc: Linux Kernel Mailing List , linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , Joel Fernandes Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 28, 2017 at 6:38 AM, Patrick Bellasi wrote: > The CPU CGroup controller allows to assign a specified (maximum) > bandwidth to tasks within a group, however it does not enforce any > constraint on how such bandwidth can be consumed. > With the integration of schedutil, the scheduler has now the proper > information about a task to select the most suitable frequency to > satisfy tasks needs. [..] > +static u64 cpu_capacity_min_read_u64(struct cgroup_subsys_state *css, > + struct cftype *cft) > +{ > + struct task_group *tg; > + u64 min_capacity; > + > + rcu_read_lock(); > + tg = css_tg(css); > + min_capacity = tg->cap_clamp[CAP_CLAMP_MIN]; Shouldn't the cap_clamp be accessed with READ_ONCE (and WRITE_ONCE in the write path) to avoid load-tearing? Thanks, Joel