Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1831917yba; Thu, 25 Apr 2019 06:29:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXzsw5jm5A/h6dHJckGfm0hoqGdBf8FwxNnvS7oDCKIpa75llo0JOxbCCi/whye61y8mGh X-Received: by 2002:a17:902:e407:: with SMTP id ci7mr39118734plb.219.1556198947074; Thu, 25 Apr 2019 06:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556198947; cv=none; d=google.com; s=arc-20160816; b=PFUr4ETtJYfDpoBHz2eYu9AOpRD+TnaZkUDJhcF+k3gXs9j4Fkupb9Xo0LJf4HanTY ORa4dP97FSLfnZ5pWEdtKMLEboETEG3ynejN/nirDJScCtPauR5xUHal4f93Kmf/d65o 1GNtyLJt+sQJpfzFT9gNslZbpUi+WcDkZg5+EoxIGJirNzru+PGkv6DsGhhuQAGSuBYp 3cX6Zri5Z2N20/6AEms7MyylC132DPZvhEoVhHbCki+u5KN6wKWQcngaUskJyyRv7vRN PAfaQM1ysQ1XvyOOQyK+Xd1LWMJMpYOApaKPTIOkO/VBuBl4RQIO8fgHougXzydetdeO zo7A== 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; bh=B7XSRVdOjDqlV5b8jdp1IfJlFRS6TNJyz/SB4r24mlY=; b=JokX5ZoxuYQpXEroSmarhRe7M0+fiaJEFu+0E9HdELPqt0kwwhUYS3wYJb8p3w26Um Beik2nCDQ4UJv2opnpOjcy/DbxG5seDsSLuADM3fBtQJinmCCLU4k5r2DAnztMp0aFpD MGMqdJoqV9OqZ7xGl/wMz25CfPCykiaUlpFgmGrWzSIxMTGd00zIRXtvtlxFg+pa4SCd FkPUYQxDN7hy9yBrHudi6I9UXjmVirkzZLXDsNpO7qOYDgkprcaOAhmPVLEOcaYpuvn0 yQ2mGKoGRpbAj3Yf5riBBzOwrXbpcMFUTgmFimcBPv6GhkEDwo3oPKIQv08bIETIK8ck KNHQ== 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 z4si21728150plk.385.2019.04.25.06.28.50; Thu, 25 Apr 2019 06:29:07 -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; 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 S1730536AbfDYK5G (ORCPT + 99 others); Thu, 25 Apr 2019 06:57:06 -0400 Received: from foss.arm.com ([217.140.101.70]:40930 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729031AbfDYK5G (ORCPT ); Thu, 25 Apr 2019 06:57:06 -0400 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 1FD81EBD; Thu, 25 Apr 2019 03:57:06 -0700 (PDT) Received: from queper01-ThinkPad-T460s (unknown [10.37.8.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD8A13F5C1; Thu, 25 Apr 2019 03:57:02 -0700 (PDT) Date: Thu, 25 Apr 2019 11:57:00 +0100 From: Quentin Perret To: Thara Gopinath Cc: mingo@redhat.com, peterz@infradead.org, rui.zhang@intel.com, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, javi.merino@kernel.org, edubezval@gmail.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, nicolas.dechesne@linaro.org, bjorn.andersson@linaro.org, dietmar.eggemann@arm.com Subject: Re: [PATCH V2 1/3] Calculate Thermal Pressure Message-ID: <20190425105658.q45cmfogrt6wwtih@queper01-ThinkPad-T460s> References: <1555443521-579-1-git-send-email-thara.gopinath@linaro.org> <1555443521-579-2-git-send-email-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555443521-579-2-git-send-email-thara.gopinath@linaro.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 16 Apr 2019 at 15:38:39 (-0400), Thara Gopinath wrote: > +/* Per cpu structure to keep track of Thermal Pressure */ > +struct thermal_pressure { > + unsigned long scale; /* scale reflecting average cpu max capacity*/ > + unsigned long acc_scale; /* Accumulated scale for this time window */ > + unsigned long old_scale; /* Scale value for the previous window */ > + unsigned long raw_scale; /* Raw max capacity */ > + unsigned long age_stamp; /* Last time old_scale was updated */ > + unsigned long last_update; /* Last time acc_scale was updated */ > + spinlock_t lock; /* Lock for protecting from simultaneous access*/ > + /* Timer for periodic update of thermal pressure */ > + struct timer_list timer; Do you actually need the periodic update ? You only really need to update the 'scale' value when updating the LB stats no ? Nobody accesses that value in between two LBs. Thanks, Quentin