Received: by 10.192.165.148 with SMTP id m20csp5301640imm; Wed, 9 May 2018 02:47:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrPz2WbmpVUergy/lQmqoBHLkI+1NF6sZpRxf+vDHh365H4m2XwDDDYn+Vw1ciKkjeDyS1J X-Received: by 2002:a17:902:988b:: with SMTP id s11-v6mr40796231plp.304.1525859238448; Wed, 09 May 2018 02:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859238; cv=none; d=google.com; s=arc-20160816; b=Lk8rSe1xsDkwTzG0oyqS+2Pfq+VjU+HUuqezgB7NUcaCQ8EORVFvGkbNkBNdrDdON1 Q7sKVxbuEvFEAPYd1lgrpiSeTG3OayYdGWi+R4N1kp0ymzhzHRXcePNB6TDFBrCDxxIW pFS8oHXVOY18ipaIGRya5nrRljKfamVoQByF0Mwnf9J1CGe5BCF77jQE8cNOINGMGbMx o7qYq0PEg8/la7pNPfiLkRCgBI/yf3/CMYrxFVokWcKTyHBlUGs9Uq0+qCY2NphZoPgd XTyksZK4dJO5hfhpeN3D35N32NJnm7BQ0i/KZBErUXS2XK4gRaly6KxxdYiypq9GJgRk h2IA== 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:dkim-signature:arc-authentication-results; bh=eYRzy0HNAdfMI6IslQPMNXG+zYgwkKOtt1RZ5ltmI5k=; b=NX+JgR6zxs2y9tnCsB/EDbYSYZcXpIMENpuaXX5v0NruCXLKHViMrJqz/o23MHSS7X CDy69opXk9s2E94SLXJNxETpxzsA4qUgXCoGybYyYbYejOplifs3NSMlBdhonPXb3jxt QUE0lvYHGPtVDH+IZ3vfo+PZKM/cx2FZDxQXi+niL0nIViNN+hj6HRnwF/RKVlCLUQ3b A/OZCQFYNHTB/tU6J3jRindG/xARvVe/3lzzHS/WmGoZEF2KIfcZrOODJaN1MozwBy0W CJx53Zk/EJ33vhaULC3Ex7c7B9wRn5IiQlzvxfKn8y6EWmIMNm1T7Uk5GfbScaRPFFO2 3raA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jmTifkDx; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si23462009pli.250.2018.05.09.02.47.03; Wed, 09 May 2018 02:47:18 -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=@linaro.org header.s=google header.b=jmTifkDx; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934106AbeEIJqZ (ORCPT + 99 others); Wed, 9 May 2018 05:46:25 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:34073 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933787AbeEIJqX (ORCPT ); Wed, 9 May 2018 05:46:23 -0400 Received: by mail-pl0-f68.google.com with SMTP id ay10-v6so3978443plb.1 for ; Wed, 09 May 2018 02:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eYRzy0HNAdfMI6IslQPMNXG+zYgwkKOtt1RZ5ltmI5k=; b=jmTifkDxAZiHRVY2NPiJc7dTsiRC46GJuu1d/2tG7L59SO86unuzqbLnQFx9Epc3Af TG/6fELmGWeqk36tHM31Y81nGzrfcCDpLvTNTiakpp8vYrl3Mtk5PVoxmZYQJSJzsyE/ Rn4oZO7SSNcRQmwaInhArMmh1ykC4kcYLidJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eYRzy0HNAdfMI6IslQPMNXG+zYgwkKOtt1RZ5ltmI5k=; b=Rhhz9bwPxPbYqIIwz8xgHwIl7zT7zh18xMVE3ndwT95XfiHmVuXioVBQCllxZw7HBn mmLEgF50QywlSOcS7iS012ZV2td+cTir96NvGZiTxOQhQoeXricvvRsMRfiIOe6Q7Aho qs/+CyCFv7Mw/z0KLovVkv78OfNq7B4KDeUHZtOOTmz1mwMM8+uNPUQ5NOPGVhCdCmB6 0mWtT+Dxe9wHJBk5fZaL8rJtzn8wi+meDqxb4asbA23vNlc7bbjXcwWJWwZ9l57/yw5f iybgiP5hzUVuOQHda6J9m2nZjgPFJAL2BrpyJcq4p43yejUXrIIaGNaOuUR9ByT3AxKH EHPA== X-Gm-Message-State: ALQs6tAzBGlqpKlb7QXqX5OSx7d1ovE8lhJpnwYn/oGQQ8zQ/vh8MLaj qK4GnT7wW5zf/Q0bZhkWO/3n/w== X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr43671692plb.240.1525859182963; Wed, 09 May 2018 02:46:22 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id z83sm23367732pfd.103.2018.05.09.02.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 02:46:22 -0700 (PDT) Date: Wed, 9 May 2018 15:16:20 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Vincent Guittot , claudio@evidence.eu.com, patrick.bellasi@arm.com, juri.lelli@redhat.com, joelaf@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: schedutil: Avoid using invalid next_freq Message-ID: <20180509094620.zblddmbxe6vxsc5h@vireshk-i7> References: <872c3f8690d9362820639d91a807e535f10a9a36.1525761635.git.viresh.kumar@linaro.org> <2276196.ev9rMjHTR0@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2276196.ev9rMjHTR0@aspire.rjw.lan> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-05-18, 11:44, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > If the next_freq field of struct sugov_policy is set to UINT_MAX, > it shouldn't be used for updating the CPU frequency (this is a > special "invalid" value), but after commit b7eaf1aab9f8 (cpufreq: > schedutil: Avoid reducing frequency of busy CPUs prematurely) it > may be passed as the new frequency to sugov_update_commit() in > sugov_update_single(). > > Fix that by adding an extra check for the special UINT_MAX value > of next_freq to sugov_update_single(). > > Fixes: b7eaf1aab9f8 (cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely) > Reported-by: Viresh Kumar > Cc: 4.12+ # 4.12+ > Signed-off-by: Rafael J. Wysocki > --- > kernel/sched/cpufreq_schedutil.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-pm/kernel/sched/cpufreq_schedutil.c > =================================================================== > --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c > +++ linux-pm/kernel/sched/cpufreq_schedutil.c > @@ -305,7 +305,8 @@ static void sugov_update_single(struct u > * Do not reduce the frequency if the CPU has not been idle > * recently, as the reduction is likely to be premature then. > */ > - if (busy && next_f < sg_policy->next_freq) { > + if (busy && next_f < sg_policy->next_freq && > + sg_policy->next_freq != UINT_MAX) { > next_f = sg_policy->next_freq; > > /* Reset cached freq as next_freq has changed */ Acked-by: Viresh Kumar -- viresh