Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1275793imm; Sun, 27 May 2018 02:50:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8EqzkQQzAfckMr6G89/CwclUDTNO4SIGuVCJcre7+3NURHO6TUeOBc+Xmx95oLbXYlA3y X-Received: by 2002:a63:82c7:: with SMTP id w190-v6mr7205061pgd.172.1527414650016; Sun, 27 May 2018 02:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527414649; cv=none; d=google.com; s=arc-20160816; b=N+YVQqWvvwTIevn3cI0JJzWfXRRqa4iwuvYtOiZzi8KGoFJ6crfCRZNWR5PPX61Yon SZ9KhSqcnJBXTGBZ92MU0qihZJhE6N7IuH6OuE2KF/oJxe2IDDIhfQVuqlL+IbSFGzNL 4/35WeF/n5cq4asElD0GRzUZkXsSe+Db7Ll/TTkyIhHguNce42j6AmbqyJRe4dDHy1He JUDP29jrSBJosSPdflcuBKMig62ZUPSfVGMXajYhsm6CGXd0hPHxPjY4Hj9890zTBMyJ e7QEdm2d27rcLGh1w9pFpAirMIi3nzSMRxI7W7cvcQNh+TL58UVec8B2TMX/kj20Ktyi AZjg== 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 :arc-authentication-results; bh=Ll1fVWuFVa69VJnB0AYjctGc3Ec4THFlBOsKiJkLyok=; b=NVeUfsUlSi8F7eYTXMy40L0AOThv/jC1J8PfrCcBVwGhnU1gi7QWhXbqN4TTTtRQKo 9RoOLvDXO/fbQlwhcf2GnICtdqV+Ebdvwcye8bG6rRq/lmx2eYCl3NvqiaNuQGWmWJvB PjvYnq4qfPd1RQgJ+hvnozK7VsIzdNfzGRKaMnWO7hB4gnqR54v6QQNEIgeB+PA9uB7y DPzWqcD6s6m0SQfDcmEc3gduPRw8bKX4zcU4ro5h4xPmKNaMkSlWBhf1N3gm1uf+ZJqh 7Mb4a9YNqqiqyLDyP8PfTkbn6e/E7gnQQY3jpihoK36fIFuAVMbOd07GNO7Qn7KXH9PQ kcMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lxj3QA5p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si5112834pla.53.2018.05.27.02.50.23; Sun, 27 May 2018 02:50:49 -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=fail header.i=@gmail.com header.s=20161025 header.b=lxj3QA5p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032561AbeE0JuP (ORCPT + 99 others); Sun, 27 May 2018 05:50:15 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:40201 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933214AbeE0JuN (ORCPT ); Sun, 27 May 2018 05:50:13 -0400 Received: by mail-ot0-f195.google.com with SMTP id n1-v6so10584559otf.7; Sun, 27 May 2018 02:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ll1fVWuFVa69VJnB0AYjctGc3Ec4THFlBOsKiJkLyok=; b=lxj3QA5pNU7E6Ulax9xSXpCgGAuog2guWofga88GrsSHlSKMzx70yL4BjdFu9eeWZq vQMmQ1jOIKjv3DYX1F9URcW+UyD8se0IiEoJkUHVb0e0Fm7YvQ+e6CthKLw7kA3g+BE6 b9XpgaB52+aTpKm7ukuctm7W1B8zs1esxEnrzvel07p30IYmXzxmaj/cb3LOTOjItzEe PjOujm+uR0Mo6NkMjO+PKI526z03rcVZag/aSJJUj9rZXFypJId9v7oLt+5dUKxUlwph +T3Ec6oGZ8e9kLIt5ug/SfjNunMkO67i9e792ODrR19+IFVE+J5gNZFQP5mYxI22kmwN Z3sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ll1fVWuFVa69VJnB0AYjctGc3Ec4THFlBOsKiJkLyok=; b=DfcoXsoayth6gePYdFGGOJirZY8Fz/3W7oYc1fTKtAsbrv7HL3Nuk5oqijUgazYnUt mDE15LOJFJIzKPhXRyoIV9K/8MW12jiznmg9lOWx8sISm+q36UnGlSJWQYUp/ytXl3OD pkciMZpdynLFS6ylV5VYjO3owyU4ufNgGD6fR+oCWJAeMkf67HRsEzQ8naf9Iyp6LROZ WqSC17vQQGHrpHLu0hz7iVhpOzyhzSv4O+PXim7e+OZ2W/H48dVigy0FGOdF2TavvlM2 g8glm4HlavfRuUAhtzULWdTmp+TPHB6nBZaStSM3hThOHLbvFu0mNovGLvFur+5l8l2S eERA== X-Gm-Message-State: ALKqPwdyYimxY7mMBknXwfz5vU2Q8B9awCBNY+EkbtP9VVpuwPugCqVj Oi0EXIDAiRMZdsvZFiCVW4kPqdONPxnMH8BCTfg= X-Received: by 2002:a9d:3e4c:: with SMTP id h12-v6mr4110933otg.150.1527414612346; Sun, 27 May 2018 02:50:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1468:0:0:0:0:0 with HTTP; Sun, 27 May 2018 02:50:12 -0700 (PDT) In-Reply-To: <20180524141023.13765-2-patrick.bellasi@arm.com> References: <20180524141023.13765-1-patrick.bellasi@arm.com> <20180524141023.13765-2-patrick.bellasi@arm.com> From: "Rafael J. Wysocki" Date: Sun, 27 May 2018 11:50:12 +0200 X-Google-Sender-Auth: VlU7I09dAD0sxvCPT8hlv3qqFek Message-ID: Subject: Re: [PATCH v3 1/2] sched/cpufreq: always consider blocked FAIR utilization To: Patrick Bellasi Cc: Linux Kernel Mailing List , Linux PM , Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , 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 Thu, May 24, 2018 at 4:10 PM, Patrick Bellasi wrote: > Since the refactoring introduced by: > > commit 8f111bc357aa ("cpufreq/schedutil: Rewrite CPUFREQ_RT support") > > we aggregate FAIR utilization only if this class has runnable tasks. > This was mainly due to avoid the risk to stay on an high frequency just > because of the blocked utilization of a CPU not being properly decayed > while the CPU was idle. > > However, since: > > commit 31e77c93e432 ("sched/fair: Update blocked load when newly idle") > > the FAIR blocked utilization is properly decayed also for IDLE CPUs. > > This allows us to use the FAIR blocked utilization as a safe mechanism > to gracefully reduce the frequency only if no FAIR tasks show up on a > CPU for a reasonable period of time. > > Moreover, we also reduce the frequency drops of CPUs running periodic > tasks which, depending on the task periodicity and the time required > for a frequency switch, was increasing the chances to introduce some > undesirable performance variations. > > Reported-by: Vincent Guittot > Signed-off-by: Patrick Bellasi > Acked-by: Viresh Kumar > Acked-by: Vincent Guittot > Tested-by: Vincent Guittot > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Rafael J. Wysocki > Cc: Vincent Guittot > Cc: Viresh Kumar > Cc: Joel Fernandes > Cc: linux-kernel@vger.kernel.org > Cc: linux-pm@vger.kernel.org Reviewed-by: Rafael J. Wysocki Or please let me know if you want me to apply this one. > --- > Changes in v3: > - add "Tested-by" and "Acked-by" Vincent tags > > Changes in v2: > - add "Acked-by" Viresh tag > --- > kernel/sched/cpufreq_schedutil.c | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > index e13df951aca7..28592b62b1d5 100644 > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -183,22 +183,21 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu) > static unsigned long sugov_aggregate_util(struct sugov_cpu *sg_cpu) > { > struct rq *rq = cpu_rq(sg_cpu->cpu); > - unsigned long util; > > - if (rq->rt.rt_nr_running) { > - util = sg_cpu->max; > - } else { > - util = sg_cpu->util_dl; > - if (rq->cfs.h_nr_running) > - util += sg_cpu->util_cfs; > - } > + if (rq->rt.rt_nr_running) > + return sg_cpu->max; > > /* > + * Utilization required by DEADLINE must always be granted while, for > + * FAIR, we use blocked utilization of IDLE CPUs as a mechanism to > + * gracefully reduce the frequency when no tasks show up for longer > + * periods of time. > + * > * Ideally we would like to set util_dl as min/guaranteed freq and > * util_cfs + util_dl as requested freq. However, cpufreq is not yet > * ready for such an interface. So, we only do the latter for now. > */ > - return min(util, sg_cpu->max); > + return min(sg_cpu->max, (sg_cpu->util_dl + sg_cpu->util_cfs)); > } > > static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time, unsigned int flags) > -- > 2.15.1 >