Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3752131ybc; Thu, 21 Nov 2019 13:11:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzRxL8XM38PgqztO6YUzkoAQMrj92l8QUlzy7NLbb8w0eWooGKYanYwHV47HQ0/j/qBqcUb X-Received: by 2002:a17:906:2552:: with SMTP id j18mr16868465ejb.244.1574370691644; Thu, 21 Nov 2019 13:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574370691; cv=none; d=google.com; s=arc-20160816; b=Isj8isO1cPhLNuAhVAzK5HJyxPxzlNFeNg+f71z7YqaIti335m1Pvlq+exfsp7jJQ4 VY0GHflAFbgZldP/wspQgNCOXS2rvXJmnu0ZPqst4rIGGl3UI8VP9FmdKFDevfWdUfm4 fiDwyvlKVCc9oJjUcjTBXj+UxKygLhBB3oz/mocy8YOlEQGXTzWsLrylbUTNGDvQWLrL ov2FolTI+P9lBsqTZnvdRWKWPuUMebtTGQ5gWeSKEyQ/pD5WqhQSqKvGDgxx161Pu/uG bHdU1+vUuBMVa+9Fq8wqleFyZwdesOOb3wD6M70keIaXE+6iYW9KGGsejInhqOW+UT0D YF0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=NENUynk4I14cLJ1gzY7kbHVItSkGHRUyltKk2t7G71k=; b=LYa+/qroamulQ7pPP7K7nMaoN7RDNzxF1dk94Lb5QtMuHBocuXZdXTVosecXtl2Vqu ve5Y9vkr8iIEugsGErBmbfNdEyJDzgTMacEpuMRBkidNJngRReRsmFM0eiaF3ETVenL9 IxhruZJI49YPXpJJxMjA1yK6xrDRigx5Wy98EETtw9XeQXOW5+WX+wii2SSB5GgNL5kR LW4SubTHiUomMZCS79eoNgrfewqXnpXS4SjKB05msrYYPjpZ30UvJjIaM5KntF4H2+iQ Qt7tc4xlr6+mjp+duYD0cTUZl7vm3PDABaXugA+EhUGi+4HNUa3sRnAA4El7UTTeIB12 8uMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g5iDPAGu; 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 b15si2725499ejv.167.2019.11.21.13.11.07; Thu, 21 Nov 2019 13:11:31 -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=pass header.i=@linaro.org header.s=google header.b=g5iDPAGu; 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 S1726922AbfKUVHX (ORCPT + 99 others); Thu, 21 Nov 2019 16:07:23 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33955 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfKUVHW (ORCPT ); Thu, 21 Nov 2019 16:07:22 -0500 Received: by mail-qk1-f195.google.com with SMTP id b188so4424596qkg.1 for ; Thu, 21 Nov 2019 13:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=NENUynk4I14cLJ1gzY7kbHVItSkGHRUyltKk2t7G71k=; b=g5iDPAGusrJ5T04T0la9VutqkiP2FlaTpfWeszcdEhnqyy+Wf4O7trjWSqztvlc2Y/ eOq0JX+qxqp862BdbChJYLpfkyRSkxU1OgZBos12SGOrDTklEIy9Oho3glmf4U8ZDkh3 Y8wIV8XPhXqjnI28AakLPiO29iU6jwSTorgYdDO+I7QVznE7zId5aO9qy/AHiwMtAOMR 4FCd24PhP/eEvqyVfd6pECXj+cBkfho5b3MlVxhnlBrWP3avZ1yQjn8pgZJxbtbga3Pz dGIP4nXO7tvKkElauREkFPC6GmkN6DVS1bbFzlyD4wBiQy7vTIEVMP31Zt+6MrQ0Tbep iCpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NENUynk4I14cLJ1gzY7kbHVItSkGHRUyltKk2t7G71k=; b=fm0e/X3fwZw69XYXA+PfiiUcPzhhydmYPjFzyQB9/55idSrm+Xt7j/W1sSu9D3tF8M 10i6h/GI9N4xwI29Wro6zAGpYkbJVsrrUFbEg3EGhQOQug9G/G/Spln93fGKydR0TRGY fh0weAbFt+eKKqbAPnd/T41znF+t98973AnnL0oxXl9+hVSwSBwlXpwCryBGNyut8P8m RChtxx43tlcBI4MBXr1NmcbIpRhv67OfSd3IUgv8S3n3JvwTszu1sr9yyXuxzYG6VoDx g5h/OY8gD0IvhBaC/fpwdW+k7nRUD41LfGDxOuuwtwruKUDDaRKfHGEalOAG5VGm5L5e DlVQ== X-Gm-Message-State: APjAAAWv5UwTleJZ6JBvgtJD88OY3DFqghL+YgqWYtEYrL5QnS5uVPjJ Y1f8KMKftt+WBCGgtvuQKjW28w== X-Received: by 2002:a37:9b4a:: with SMTP id d71mr9974147qke.0.1574370441784; Thu, 21 Nov 2019 13:07:21 -0800 (PST) Received: from [192.168.1.169] (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.gmail.com with ESMTPSA id d139sm1983435qkb.36.2019.11.21.13.07.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 13:07:20 -0800 (PST) Subject: Re: [PATCH] drivers: thermal: step_wise: add support for hysteresis To: Amit Kucheria References: <8e812065f4a76325097c5f9c17f3386736d8c1d4.1574315190.git.amit.kucheria@linaro.org> <5DD69AB7.3060307@linaro.org> Cc: Linux Kernel Mailing List , linux-arm-msm , Bjorn Andersson , Stephen Boyd , "J, KEERTHY" , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Amit Kucheria , Ram Chandrasekar , Lina Iyer , Linux PM list From: Thara Gopinath Message-ID: <5DD6FC87.6040403@linaro.org> Date: Thu, 21 Nov 2019 16:07:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/21/2019 09:38 AM, Amit Kucheria wrote: > On Thu, Nov 21, 2019 at 7:40 PM Thara Gopinath > wrote: >> >> On 11/21/2019 12:50 AM, Amit Kucheria wrote: >>> From: Ram Chandrasekar >>> >>> Currently, step wise governor increases the mitigation when the >>> temperature goes above a threshold and decreases the mitigation when the >>> temperature goes below the threshold. If there is a case where the >>> temperature is wavering around the threshold, the mitigation will be >>> applied and removed every iteration, which is not very efficient. >>> >>> The use of hysteresis temperature could avoid this ping-pong of >>> mitigation by relaxing the mitigation to happen only when the >>> temperature goes below this lower hysteresis value. >> Hi Amit, >> >> Can this not lead to ping-pong around the hysteresis temperature? > > That isn't how hysteresis is supposed to work if there is a sufficient > delta between your trip point and your hysteresis value. > > e.g. if you have a trip at 80C and a hysteresis of 10C, it means that > you will start throttling at 80C, but you won't STOP throttling until > you cool down to 70C. At that point, you will wait again to get to 80C > before throttling again. > IOW, on the downward slope (80 -> 70) you still have throttling active > and on the upward slope (70 -> 80), you have no[1] throttling, so > different behaviour is the same temperature range depending on > direction. > > If your hysteresis value was very low .e.g. 1C, it would certainly be useless. Thanks for the explanation. I think averaging can still give a smoother experience/transition. But then it has to be implemented and tested against this solution. Other reason for this solution is hysteresis can be a higher value if needed where as averaging might not give that flexibility. I have some other comments on the patch which I have posted separately. > >> If the idea is to minimize ping-pong isn't average a better method? > > We shouldn't ping-pong with the asymmetric behaviour described above. > > Regards, > Amit > [1] This is a simple example with a single trip point. > -- Warm Regards Thara