Received: by 10.223.176.5 with SMTP id f5csp540926wra; Fri, 9 Feb 2018 03:15:46 -0800 (PST) X-Google-Smtp-Source: AH8x226wBwuDqHwv7DOvO8ltsEL45TlbAYgeWFmxv3qwKHSJSJl2/ehMg6M4wjRjgjXlJMcmVmBT X-Received: by 10.99.139.199 with SMTP id j190mr2098211pge.188.1518174946206; Fri, 09 Feb 2018 03:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518174946; cv=none; d=google.com; s=arc-20160816; b=0jEyYsKGGQVIhpCG4GkI23G2thcIrY/jo1c/+cvslEiuYGDKNbkZoASe6HX+JkkYCB hcNOcv5viiRQzRmhI3/Xj4l7AQAcnhn0vaE7GqNQukxJS3HrMN0R9tSJeEhM7cSh21PG 9MTYr8m3FLKlOKihChK9ytQj8l/hsYBDobB0lS0+mEKH+AxjBepXetfnRVUOzISzd2VN ueRsnK5sj8X3vE4H2BIXXgZlxU5XmzxKKLBbaAnSY3HMkLU++MjDAFgTcEPec132O8Ii FNFOZ3NlQJfX8gB04o+crCOcEWszoAwoZtzVLiaab5zKFpY40xYWIJm9PoB8ZL6G6RaX Z7Fw== 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=T0JUK/2sro3iUX6ZgOq9jGiv7NwgWvDr7Ohf/0LLT14=; b=TmBrQDW/dVFnByIAqG5S9uTdqL/q1+2s0chUBwB3DtdcOCGoeP/rH4dcEt8UwUy4h5 SIKvWwBlwiqH+SbRsq7BAPj7AOjgeHzLvWHxUmHsZGGNAyVDgGHgiG7ouMiJPz+vChCR 2uVOXb/q9cazSpiqO+i9KlWRglBEYCEL4su1PkxI2XaZp68n3/yeSepCC+mNej+9lLV3 6t/FFdm+cFLCRv3dwGDz7xocHMXXMjIRM1QQfNmGKJI/52LkvqcSTkk06yv8PJbK6NT7 9kQOp8wFgYtBqGojBNXDuNfKw6v7jEbPLAT5uc/hO/v7momXB3xcvFkako97PYgk9VX0 YudA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Kapx4m/j; 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 v2-v6si1409981plo.525.2018.02.09.03.15.32; Fri, 09 Feb 2018 03:15:46 -0800 (PST) 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=Kapx4m/j; 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 S1752171AbeBILOv (ORCPT + 99 others); Fri, 9 Feb 2018 06:14:51 -0500 Received: from mail-ot0-f196.google.com ([74.125.82.196]:45239 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbeBILOr (ORCPT ); Fri, 9 Feb 2018 06:14:47 -0500 Received: by mail-ot0-f196.google.com with SMTP id 73so7388542oti.12; Fri, 09 Feb 2018 03:14:46 -0800 (PST) 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=T0JUK/2sro3iUX6ZgOq9jGiv7NwgWvDr7Ohf/0LLT14=; b=Kapx4m/jgYbHpot1ywM6YbFjYSk8OjhiK0gnOrenpEuYo2/w46HdZy/yEHOHiqjfKr Fzob1DKWE8VHZA1uTq3blhIDvhU+Tcl1j/KmMdmsRaI32XY/wweQDB9YVUJkOXNaVVJH r3Y4O8aS8p7zxlfnfzYwB6NJNPxwpjHklU+ykVtew0BlVUQGT85hXHDCaZORjylGF4Qe v7LUIcRVD3fXbktf3mBo61iN51lLOg1kOH3sYO4SimuJLR+iJRhOOxUqEpu0HxLF+j1G d33Y5WsgDm5azGu1sKjrDYkqwHJk+g+nN+tdrvUEftijXzRgNbVpBWeP9GFDUTBcs0Dq +rUQ== 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=T0JUK/2sro3iUX6ZgOq9jGiv7NwgWvDr7Ohf/0LLT14=; b=LJJM+FAbreN2PGGsj9T9nVlgxp4BqVNam33hKrZwqpqyZ/uRxEKqDrPaup1UJxCcHY 5xHZKl1RF/2t4czyHcg6/fjFMyvYKnWA0nE7wzBJaInqtRcqT8045eYQKBmrTV6G35BY PIyEJlHdaVhkdB0aVZ8A2BlagTdYQoNpWYWc4dUlQaASujGlkFMBikFhUmBMsap+88uJ XmCCToboiop6IoVxjGhenCntM3JXqRqJzpJUmlFLTBxV2b2L/MUNDMtqHlc0Akm8Wx5c glnOXKRU+o2wNvyZnpZrXy4BknF7/7ylMyLCcik1u9HVP8CyRr5MK0ZNKW0Jo/Xnh+8b /amA== X-Gm-Message-State: APf1xPC/pzI6CSV3lPKxp+VjkLmiO3xmNWfeetOKYmFIIpdThLc9+vPD d+HlI0f3e8+OGu5BABjlzqNNwaUCnL1aSZQtYvY= X-Received: by 10.157.46.90 with SMTP id c26mr2005460otd.310.1518174886200; Fri, 09 Feb 2018 03:14:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.46.234 with HTTP; Fri, 9 Feb 2018 03:14:45 -0800 (PST) In-Reply-To: <1518109302-8239-1-git-send-email-claudio@evidence.eu.com> References: <1518109302-8239-1-git-send-email-claudio@evidence.eu.com> From: "Rafael J. Wysocki" Date: Fri, 9 Feb 2018 12:14:45 +0100 X-Google-Sender-Auth: XTAGXR5wjFdvXxBdDIc4fFwXkPw Message-ID: Subject: Re: [PATCH] cpufreq: schedutil: rate limits for SCHED_DEADLINE To: Claudio Scordino Cc: Peter Zijlstra , Ingo Molnar , "Rafael J . Wysocki" , Patrick Bellasi , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Viresh Kumar , Vincent Guittot , Todd Kjos , Joel Fernandes , Linux PM , Linux Kernel Mailing List 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, Feb 8, 2018 at 6:01 PM, Claudio Scordino wrote: > When the SCHED_DEADLINE scheduling class increases the CPU utilization, > we should not wait for the rate limit, otherwise we may miss some deadline. > > Tests using rt-app on Exynos5422 have shown reductions of about 10% of deadline > misses for tasks with low RT periods. > > The patch applies on top of the one recently proposed by Peter to drop the > SCHED_CPUFREQ_* flags. > > Signed-off-by: Claudio Scordino > CC: Rafael J . Wysocki > CC: Patrick Bellasi > CC: Dietmar Eggemann > CC: Morten Rasmussen > CC: Juri Lelli > CC: Viresh Kumar > CC: Vincent Guittot > CC: Todd Kjos > CC: Joel Fernandes > CC: linux-pm@vger.kernel.org > CC: linux-kernel@vger.kernel.org > --- > kernel/sched/cpufreq_schedutil.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > index b0bd77d..d8dcba2 100644 > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -74,7 +74,10 @@ static DEFINE_PER_CPU(struct sugov_cpu, sugov_cpu); > > /************************ Governor internals ***********************/ > > -static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > +static bool sugov_should_update_freq(struct sugov_policy *sg_policy, > + u64 time, > + struct sugov_cpu *sg_cpu_old, > + struct sugov_cpu *sg_cpu_new) This looks somewhat excessive for using just one field from each of these. > { > s64 delta_ns; > > @@ -111,6 +114,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > return true; > } > > + /* Ignore rate limit when DL increased utilization. */ > + if (sg_cpu_new->util_dl > sg_cpu_old->util_dl) > + return true; > + > delta_ns = time - sg_policy->last_freq_update_time; > return delta_ns >= sg_policy->freq_update_delay_ns; > } > @@ -271,6 +278,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > unsigned int flags) > { > struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util); > + struct sugov_cpu sg_cpu_old = *sg_cpu; And here you copy the entire struct to pass a pointer to the copy to a helper function so that it can access one field. That doesn't look particularly straightforward to me, let alone the overhead. I guess you may do the check before calling sugov_should_update_freq() and set sg_policy->need_freq_update if its true, as you know upfront that the previous sg_policy->next_freq value isn't going to be used anyway in that case.