Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4472050imm; Tue, 11 Sep 2018 12:27:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTg/ODDioNNMeX7mCed1IgCtlgSp+kNp2XCVrEWUfaAErCs2YPhQcr9/6KjzomQvTm35bi X-Received: by 2002:a63:ac54:: with SMTP id z20-v6mr29039148pgn.74.1536694028859; Tue, 11 Sep 2018 12:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536694028; cv=none; d=google.com; s=arc-20160816; b=mZMJI7UPAQad3f4snmtQ0VsdYs1bBlIV2y5k8/1oPv2unTi2WsMOeHPy+Zd1V/kNZh GZKaGHYJMjQQJecP5ZeA3+aPeea5yljzjMnxD7C7b7qLSo++vWZXG5mEHuKU7axJ35ZY OVwJTBXohmDeXmn0WTXluA9lH0JdlR1BkVJ+yOPWA1YJfZBfgMAbLGUKp+8k3dGEYGTw nAbM3yk3VnOT5R0jSwdAu/HdzLND0ceHldtFOBImE0lQP/3dfDlCp/qRwsTHxbgWS8/z jJkn3/PL3K1pL8ABr8kKTs+3Zu2F1GKhIwVG7ZKt/PqFux97yidwVPqBAwWRwqaww/vK wCuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=wbJZNCvLlgJSFs/3QgwbaycN4QcEpBXubnHmC/YM7bY=; b=Ss7/vUrLAEqOJMtyZNW0Ni3dB2D00p4v4EvByBqQsvoSICshdJoT2wbjaa5VEE05XV qTc6TdeeDYiXN6qUzw3xoHPlBma2TzmAj9MtiWXvopqy+7xD1dKGQPsXBuz81tKfCKJY gw2doxRzUBcAgHu9pRLFU4r8wyKjFWIonnXiEIR3ejduC6mkVOltZ2ew7LlwV0ioiYOb slUczNdnQkCqwwOed2s8fvB3wjHAolea5k7VUW8LiU1Bqq3nht8FkgYDL8jVkZyGA0aA epV0hXHaOz9pCxSbKtG6XUze0r/6w95+Gw7QcTeGHldHggKesq4tcmkLLX++LxyO8kFR z+1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oZ7Y+rqm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si20449094pfi.99.2018.09.11.12.26.52; Tue, 11 Sep 2018 12:27:08 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=oZ7Y+rqm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727246AbeILA0P (ORCPT + 99 others); Tue, 11 Sep 2018 20:26:15 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36912 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbeILA0O (ORCPT ); Tue, 11 Sep 2018 20:26:14 -0400 Received: by mail-wr1-f65.google.com with SMTP id u12-v6so27162536wrr.4 for ; Tue, 11 Sep 2018 12:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wbJZNCvLlgJSFs/3QgwbaycN4QcEpBXubnHmC/YM7bY=; b=oZ7Y+rqmVvawzBn9t1hGx+4NWXzxboJhahE4k8J9opbdJ8kTp1iIGX5xvwp4RxMRts qQMaEeePgAYohVYXwuMZZpM6K6EQITsAVDkuM29UAvrQkr0PXj2kMUocvTZ1kshLceWc wZyj0ckfDlxcCoZAtn2mkOsGn4aEgHXk8l4KRpzqXHG1xt7HG+g94ruZkljGUv2g7tC9 6mCdE/Z5IQj2LxM/Gjrfc1FwnSs8n+sF9/t0XKlKZ+t/jSx386KdUZqfkqpFDQjZ/Y1j ATU2drUZcO40wsiElldEJmuBjzUdK55jj+YZurqsN4f7hIVrtEybS2Awn/F4WEZFSLCN 2frg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wbJZNCvLlgJSFs/3QgwbaycN4QcEpBXubnHmC/YM7bY=; b=kTvm1rWvXfs67vsAWHaSfDvXN08M6AAJKP8xcMTjJfAhvooGGzcB8ZuyXOOk5Pw1hA Eoh8CCRFDQhLRzRzSUSY4V7+A9jEMuD80cT7sKYNMto5Wc8RzBZPGwYzqDGADGRjtJRr DGztzSHtLaRBZsiSM5JzHCwuMKxS8nYI4P+Od+78gzoW7nl9IenvHLWHGMzutaAWfVcI EbcqFWpMFTtBzyu5+ayCIHkjCa4CVF0UXtmOnxnAQ8fg9ERGaAd0bEUWLND7qPO3jpOt APLEv5EgCkP/BaPnniQg/0xXeKgBG6E6z8lCqeLymkPmGI0yNdBHaG81TRCbFBP3cJJv WLwQ== X-Gm-Message-State: APzg51BYO+Jzm6y72SBEPTWHsc3K2yl5q0SMKK/pMuREzZN4bdbwKryE mvM+g5HjcfffShaxu3H0btUuKWoD6gGxZcGZvuJkCA== X-Received: by 2002:adf:f24e:: with SMTP id b14-v6mr18216992wrp.184.1536693928584; Tue, 11 Sep 2018 12:25:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:c710:0:0:0:0:0 with HTTP; Tue, 11 Sep 2018 12:25:28 -0700 (PDT) In-Reply-To: <20180911164637.GC1413@e110439-lin> References: <20180828135324.21976-1-patrick.bellasi@arm.com> <20180828135324.21976-12-patrick.bellasi@arm.com> <20180911164637.GC1413@e110439-lin> From: Suren Baghdasaryan Date: Tue, 11 Sep 2018 12:25:28 -0700 Message-ID: Subject: Re: [PATCH v4 11/16] sched/core: uclamp: add system default clamps To: Patrick Bellasi Cc: LKML , linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 9:46 AM, Patrick Bellasi wrote: > On 10-Sep 09:20, Suren Baghdasaryan wrote: >> On Tue, Aug 28, 2018 at 6:53 AM, Patrick Bellasi >> wrote: > > [...] > >> > @@ -1509,12 +1633,17 @@ static void __init init_uclamp(void) >> > uc_se->group_id = UCLAMP_NOT_VALID; >> > uclamp_group_get(NULL, clamp_id, 0, uc_se, >> > uclamp_none(clamp_id)); >> > + /* >> > + * By default we do not want task-specific clamp values, >> > + * so that system default values apply. >> > + */ >> > + uc_se->value = UCLAMP_NOT_VALID; >> > >> > #ifdef CONFIG_UCLAMP_TASK_GROUP >> > /* Init root TG's clamp group */ >> > uc_se = &root_task_group.uclamp[clamp_id]; >> > >> > - uc_se->effective.value = uclamp_none(clamp_id); >> > + uc_se->effective.value = uclamp_none(UCLAMP_MAX); >> >> Both clamps are initialized with 1023 because children can go lower >> but can't go higher? Comment might be helpful. > > Yes, that's because with CGroups we set the max allowed value, which > is also the one used for a clamp IFF: > - the task is not part of a more restrictive group > - the task has not a more restrictive task specific value > > I'll improve this comment on the next respin. > >> I saw this pattern of using uclamp_none(UCLAMP_MAX) for both clamps in >> couple places. > > The other place is to define / initialize "uclamp_default_perf", which > is the default clamps used for RT tasks, introduce by the last patch: > > https://lore.kernel.org/lkml/20180828135324.21976-17-patrick.bellasi@arm.com/ > > So, RT tasks and root task group are the only two exceptions for > which, by default, we want a maximum boosting. > >> Maybe would be better to have smth like: >> >> static inline int tg_uclamp_none(int clamp_id) { >> /* TG's min and max clamps default to SCHED_CAPACITY_SCALE to >> allow children to tighten the restriction */ >> return SCHED_CAPACITY_SCALE; >> } >> >> and use tg_uclamp_none(clamp_id) instead of uclamp_none(UCLAMP_MAX)? >> Functionally the same but much more readable. > > Not entirely convinced, maybe because of the name you suggest: it > cannot contain tg, because it applies also to RT tasks when TG are not > in use. > > Maybe something like: uclamp_max_boost(clamp_id) could work instead ? Sounds good to me. > > It will make more explicit that the configuration will maps into a: > > util.min = util.max = SCHED_CAPACITY_SCALE > > Cheers, > Patrick > > -- > #include > > Patrick Bellasi