Received: by 10.223.164.202 with SMTP id h10csp117128wrb; Thu, 30 Nov 2017 07:46:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMYl9DBZ9FHStMOnOMjSfSdStBVoJDA38r6bIfNt/RUUCIUTPcKxF5x1YI5MeKTgHmufvN/F X-Received: by 10.84.240.203 with SMTP id l11mr3025499plt.211.1512056767127; Thu, 30 Nov 2017 07:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512056767; cv=none; d=google.com; s=arc-20160816; b=aVTyKocHTVAEQXyOls6wPS67+fvcd0lsur50Q7OgHBJ22bkG0K2ZiLVnDjukbKr+Te 8MYKU9vGyVy3SDPABaVEzPkllWMlYXu6IOlubZM5bmHw+EuxPCz36jHQP41o1MNgdE/T iHvLXusLjXd3aMpbyWUyS5k2OR6Z7Zy0rTTDqfrRALKrK8Z3u25T0rCgUkj2i0SsKy5g UP5nAZ0/05/Nc5IsAlGJ3wrwmR0X7QWCs/Hs6B2hme0jkSOzReLPv1d9dr82+JyNM8av OFZ0ePFbqtZw/tK3ZzX2UaQjRUOi2Jjba8OHhPeK4fxjEINGDP1ciaZyxxHlz3VnxA15 ll+g== 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:arc-authentication-results; bh=5Ntxw3iVJWu2nMWW34n0y28KvQ8hWYesm9AO8TAzyTE=; b=fiXaNGR3vLE33DkugyrcTxcRhTUprcVfn0pMnndAUBoi19KJW1UGey8gbV8UWJ1+lR m220xhVx1oES8UoNI++gRGNkUJ5nfIHX42viWShwwfacwVT3WMaVVmTa1WzPSOXoq7SC A7ar43anQmQdbMuT+OU2AJx0wlBosf5QiNJKuOfqyHZssYWNTiFCY5tKHnTDtvjXe62y nlPphRGHMl+76a4GI4lgS1aRGvR2exgd+ydZAhTQKU07vKe2vHKzGcMtjwIMjblocxaT Xn2T9FsllZbFQWCJG1R/N4JOZP8EAQvLZO3dJUerO9TjxGGf8LEIw6YxE6XeHsNCjMq5 0qNw== 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 y3si3158471pgp.554.2017.11.30.07.45.53; Thu, 30 Nov 2017 07:46:07 -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; 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 S1753108AbdK3PpN (ORCPT + 99 others); Thu, 30 Nov 2017 10:45:13 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbdK3PpL (ORCPT ); Thu, 30 Nov 2017 10:45:11 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 144B815A2; Thu, 30 Nov 2017 07:45:11 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0E0D3F318; Thu, 30 Nov 2017 07:45:08 -0800 (PST) Date: Thu, 30 Nov 2017 15:45:06 +0000 From: Patrick Bellasi To: Juri Lelli Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Todd Kjos , Joel Fernandes , Steve Muckle Subject: Re: [PATCH v3 2/6] cpufreq: schedutil: ensure max frequency while running RT/DL tasks Message-ID: <20171130154506.GD31247@e110439-lin> References: <20171130114723.29210-1-patrick.bellasi@arm.com> <20171130114723.29210-3-patrick.bellasi@arm.com> <20171130131759.GB9903@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130131759.GB9903@localhost.localdomain> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-Nov 14:17, Juri Lelli wrote: > Hi, > > On 30/11/17 11:47, Patrick Bellasi wrote: > > [...] > > > @@ -340,6 +349,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > struct sugov_policy *sg_policy = sg_cpu->sg_policy; > > unsigned long util, max; > > unsigned int next_f; > > + bool rt_mode; > > > > sugov_get_util(&util, &max, sg_cpu->cpu); > > > > @@ -353,17 +363,27 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > sg_cpu->flags = 0; > > goto done; > > } > > - sg_cpu->flags = flags; > > + > > + /* > > + * While RT/DL tasks are running we do not want FAIR tasks to > > + * overwrite this CPU's flags, still we can update utilization and > > + * frequency (if required/possible) to be fair with these tasks. > > + */ > > + rt_mode = task_has_dl_policy(current) || > > + task_has_rt_policy(current) || > > + (flags & SCHED_CPUFREQ_RT_DL); > > + if (rt_mode) > > + sg_cpu->flags |= flags; > > + else > > + sg_cpu->flags = flags; > > > > sugov_set_iowait_boost(sg_cpu, time, flags); > > sg_cpu->last_update = time; > > > > if (sugov_should_update_freq(sg_policy, time)) { > > - if (flags & SCHED_CPUFREQ_RT_DL) > > - next_f = sg_policy->policy->cpuinfo.max_freq; > > - else > > - next_f = sugov_next_freq_shared(sg_cpu, time); > > - > > + next_f = rt_mode > > + ? sg_policy->policy->cpuinfo.max_freq > > + : sugov_next_freq_shared(sg_cpu, time); > > sugov_update_commit(sg_policy, time, next_f); > > Aren't we already at max_freq at this point (since an RT/DL task is > running)? Do we need to trigger a frequency update? I think that's required to cover the first time we enter rt_mode in order to jump to max OPP. If we are already at max OPP, sugov_update_commit() will just bail out without doing anything. Am I missing something? > > Best, > > Juri -- #include Patrick Bellasi From 1585497212837614080@xxx Thu Nov 30 13:19:30 +0000 2017 X-GM-THRID: 1585491569188272266 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread