Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1391415imm; Tue, 22 May 2018 03:23:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrv+zW/szcN3HL9JsUw3JrTwxc+yOzFr/FtW/9kSeIUbmJu3HxDHs0ANu6Vr58XSgv99PAn X-Received: by 2002:a65:408c:: with SMTP id t12-v6mr6620435pgp.222.1526984621120; Tue, 22 May 2018 03:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526984621; cv=none; d=google.com; s=arc-20160816; b=CXU+v/npOBNWrqyt1StgQw2jY7v1QENVifBZVRQFqEz15TRecT8X+JzjeRoGwFQNiZ MNWMvHrHla7TeCq7ASc0GmfcB5YK2wjJgw/Oa2Ghh0Ugiw1jOdh474iDESvL1l/8hETL KXwWkH2D68BXIF4HgBKrsVN7Flh26okeCzyydt9WfBvdTL6gxiMiGollly1eCvwEP6dN FJbZWWZNqTRGzjdKllQy4ZufsFiUdMeBovOnOPajsHPclyHQ2nyHxvbfl6TpQ2liudJe eO/a2Kg+NmgfZHytQFavz0by1RSW15QC8U8wSgBVL0zJsMPBX8ySJPoFnDIwJxvXAb6U QnEw== 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=0Louc/EaT51/7VS3X1YyokZM1f9yjBNa9MnEPNYkU3I=; b=GRLgWL0cGFcstvXRr7MQZlUAA9JWaVhFHTMAJeqX+vAqyAR/FHruxpDO29P3zqmKzR +9WFLeEXw0XqYqDQPVJQo7INt+9cnvkhn4w1jaSS8My21bvFdyRuW9GjKzL/x4hv+MRd VMJKW1tAsQ9M56GVcIeCfkj6scKxgy0/LuCJB9nQbIR2aCX1JFSCg2N9AemPHoYf0MU/ xQ73IMHyfyaywOzOCePK1WJXGz998ZcgKs61rkuYQBvcLOgGmowMoSBbX8nIza2owTfC WB3EFhqiaOGL9f7toa18BhQliQFqqltOvCCjDrRfpkU2N50MN7tnWYj6/EGNHaVWZ7EK uFOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V3CSbBFu; 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 t23-v6si17220853plo.508.2018.05.22.03.23.26; Tue, 22 May 2018 03:23:41 -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=V3CSbBFu; 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 S1751363AbeEVKXN (ORCPT + 99 others); Tue, 22 May 2018 06:23:13 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:40525 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbeEVKXJ (ORCPT ); Tue, 22 May 2018 06:23:09 -0400 Received: by mail-pg0-f67.google.com with SMTP id l2-v6so7672484pgc.7 for ; Tue, 22 May 2018 03:23:09 -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=0Louc/EaT51/7VS3X1YyokZM1f9yjBNa9MnEPNYkU3I=; b=V3CSbBFupOWvEro69fo+7QAbxHPMEJ1P/UcIoYRQKgArqhmvRBazGDqRvAomfruS9P 1HO5gM5holC7aPh+1BmoV+8MvWj7GD7/+mK88yAjwqwUs9NzPyIaW/986KHHvgrIL4zB EQOvcj7M10mRUJmIsuzm4PlfixHPaxXeVqHc8= 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=0Louc/EaT51/7VS3X1YyokZM1f9yjBNa9MnEPNYkU3I=; b=DhIbcipIA7DsKW9DUKf8Z31p9T5EqHsjaeR/SdLBV8LYAn2mFWdFwh17Kw0KhDAoaN IDd/mXWyq2OyJ2NPQNgnCac8GXwLy2+sG+lGH9h7GBbyVGjPfn2jFJ5oEOJo+GDNYIY7 DygLW0p6kWdSOXK52u/bU1OkBSDOVN/6d70wRtsj2+c8dBSQMJ8Kfx+HtVjusxtPFavr Wyk3wL0fNJM7bkReSTQLNkPy+NSUbFhcRKettm/KfWqQzaxOsTF8uJuE6u0bhtvpJq4N dIwAZcMz10OJ1Dz6nJSoVCG3nFQr1vzR1Y/pD+jV8rUYIpfjl28MLFTr4wVeG6vFjbvn kl6g== X-Gm-Message-State: ALKqPwfejJFkVmHl9jpWSFWC6qm/ywHW74aWfDis1i0Yq2Gfi/h5qFgh 0VGKcfBngkt2g8oS20t7KDShEQ== X-Received: by 2002:aa7:810f:: with SMTP id b15-v6mr23285324pfi.79.1526984588625; Tue, 22 May 2018 03:23:08 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id p12-v6sm20943570pgn.26.2018.05.22.03.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 03:23:07 -0700 (PDT) Date: Tue, 22 May 2018 15:53:05 +0530 From: Viresh Kumar To: Joel Fernandes Cc: Patrick Bellasi , "Joel Fernandes (Google.)" , linux-kernel@vger.kernel.org, "Rafael J . Wysocki" , Peter Zijlstra , Ingo Molnar , Juri Lelli , Luca Abeni , Todd Kjos , claudio@evidence.eu.com, kernel-team@android.com, linux-pm@vger.kernel.org Subject: Re: [PATCH v2] schedutil: Allow cpufreq requests to be made even when kthread kicked Message-ID: <20180522102305.uxph4u4o2zrvu4tx@vireshk-i7> References: <20180518185501.173552-1-joel@joelfernandes.org> <20180521105055.GQ30654@e110439-lin> <20180521154957.GA14065@joelaf.mtv.corp.google.com> <20180521170050.GT30654@e110439-lin> <20180521172001.GA21678@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180521172001.GA21678@joelaf.mtv.corp.google.com> 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 21-05-18, 10:20, Joel Fernandes wrote: > On Mon, May 21, 2018 at 06:00:50PM +0100, Patrick Bellasi wrote: > > If that's the case, this means that if, for example, during a > > frequency switch you get a request to reduce the frequency (e.g. > > deadline task passing the 0-lag time) and right after a request to > > increase the frequency (e.g. the current FAIR task tick)... you will > > enqueue a freq drop followed by a freq increase and actually do two > > frequency hops? I don't think so. Consider the kthread as running currently and has just cleared the work_in_progress flag. Sched update comes at that time and we decide to reduce the frequency, we queue another work and update next_freq. Now if another sched update comes before the kthread finishes its previous loop, we will simply update next_freq and return. So when the next time kthread runs, it will pick the most recent update. Where is the problem both of you see ? -- viresh