Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1876642yba; Thu, 25 Apr 2019 07:09:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwykSL3cRXvC7o4RFJdVRj5yF0Aogsh+0GjfnOseqkcWyKQ1TN3KXWTmEmdi6vTSQ8hgKeB X-Received: by 2002:a17:902:b10a:: with SMTP id q10mr6122676plr.303.1556201384538; Thu, 25 Apr 2019 07:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556201384; cv=none; d=google.com; s=arc-20160816; b=b0GIaOpdxsoQu2ymPxPqfbYA/n715XpStPavH4+zeBYt81dbIHPjgzbPPuYSeKPQeX AoAHRgco/ox5Gub0QI2RxpTBSPgvkAJXEprn0Mscj9tSsck8luMEYCYtHgnV8OHEMLba mtEPhGlBswy6eY9UfQjzbEmypA0waX7vQEBEMZFjUsUHDLChg9s50ZmyVbV6p9o+/pvs ndWafcqpatnpG+zKd2ulRRoZrZqOA/MT57lql6LvajcwNtQZgk+Jz0Nv0P+R74QpWBji HgOyeSqvcfkheVbKMsaiM2fZL5LW4Q86BPvKRz/gBqIIs3Sm5elCkynClJMi+f/ae07F WryQ== 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=H1K8qiQ1r1sGKVAjKJxi4RguMPgLWHsMma9m11UswbA=; b=NN8feQdqrHHgoncgqgpyQhMk2L2vkTVax6sqSxnqUCmM+/2K5VW+Hab0SS9RvK7oPO ESyJcZC98aAthEIxLOcUqK4p0ItJaAmGDK7CvQap0D1dH5zb0bMmKrqTQq+hBpcL+DzD imQVZs39pEoHTQ6SZ8wO+KcHHS4McSajhZShkPNNSsPHS85ck7LuoK2JB+fJG2x7VIB8 ukaXtBZMR84WpvlEFP/kG0xFFmdj+BU6nYbAvJMuQgt1B55uur4sUiioQ12Khe2mfulO L2z8mHFjfdvvnHt+0AIffuPfEsZT463oqrJzL2IVyv54nQ6XgdHO7T2XWcN0ehl3mBUN 3FYw== 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 f127si22835934pfc.176.2019.04.25.07.09.25; Thu, 25 Apr 2019 07:09:44 -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 S1727711AbfDYMrt (ORCPT + 99 others); Thu, 25 Apr 2019 08:47:49 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727638AbfDYMrs (ORCPT ); Thu, 25 Apr 2019 08:47:48 -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 44947A78; Thu, 25 Apr 2019 05:47:48 -0700 (PDT) Received: from queper01-ThinkPad-T460s (unknown [10.37.8.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AEDC53F5C1; Thu, 25 Apr 2019 05:47:45 -0700 (PDT) Date: Thu, 25 Apr 2019 13:47:44 +0100 From: Quentin Perret To: Vincent Guittot Cc: Thara Gopinath , Ingo Molnar , Peter Zijlstra , Zhang Rui , linux-kernel , Amit Kachhap , viresh kumar , Javi Merino , Eduardo Valentin , Daniel Lezcano , Nicolas Dechesne , Bjorn Andersson , Dietmar Eggemann Subject: Re: [PATCH V2 1/3] Calculate Thermal Pressure Message-ID: <20190425124741.y5stnnf7moujmout@queper01-ThinkPad-T460s> References: <1555443521-579-1-git-send-email-thara.gopinath@linaro.org> <1555443521-579-2-git-send-email-thara.gopinath@linaro.org> <20190425105658.q45cmfogrt6wwtih@queper01-ThinkPad-T460s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 25 Apr 2019 at 14:45:57 (+0200), Vincent Guittot wrote: > On Thu, 25 Apr 2019 at 12:57, Quentin Perret wrote: > > > > 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. > > Do you mean calling a variant of sched_update_thermal_pressure() in > update_cpu_capacity() instead of periodic update ? > Yes , that should be enough Right something like this, and remove all the timers. Should be a bit cleaner I guess. Thanks, Quentin