Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1875858yba; Thu, 25 Apr 2019 07:09:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd1qDoiwEgVwlJHt6t58NYGi5ZgFLSsj0onaBTZamUr5gNmd1AL0Gx0e/cZ3LPifPokJed X-Received: by 2002:a65:614e:: with SMTP id o14mr2039701pgv.196.1556201346407; Thu, 25 Apr 2019 07:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556201346; cv=none; d=google.com; s=arc-20160816; b=wplSEHpm0e/6ery+mCzmrdbmC4mwC9lCi1NYC24ZKxuzWUFZagikTpBLMftiYlF3vC VhZGGqc4CJi9cTpEasxVVwv+Ei7wHloFNkluuKHNmRfaq/Yfoa7jCRugaDAWhk+4kk6s y1MghCc77bkwy+I3P49lm53mEYdGmMJwsI6lru0o45A2F67MXCVVHV7Ee108k2SrsjtB QP+6xCVQ25IPVZor2bSa9NaOuUsBjdXuxBgN3cSupcmTWeS5sItlMrMtwcjBTP/JVJCC WROPkmkuRlxxRtVqNh4iK5ctOzZxzJSSFMNrQ5y7kRgcrcjBzuEJ5vXR1gKR36fcjsNP sckA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tpwgTt2BmSUg0ivYIfToBDS6B13YYAHn04kCE0XlNQA=; b=guR8O4NcAZHTG2Mz5e4by5GSDDvu3P89oguqAyOVOFmKCBKQ9bCooBi+crYO0F6dMp DZEdX6Cp2H/H18Mj4hGqiBHk9v8iuTt9J3KusJYLf5Bsj9cAjWCOKVOuJ/SkmZdCnXht Agw35wfjIfZOFDcn+J9eIle4if6QrBG3wcL5gGMQjrBUpqwfb2kDSIjc5zcbPvtipxfp Vi35PBH17L4k02rOqWkpdln4wegaxFBhtZXzv+ni6Krwb/F8Yh9Y/OA6lCvUGpfdxCWU LVLELxuDYzXfZVxCzZeb5gx8Aejc5sApC9yc0YvRSmSoR9MkipGvEDTzokwBSscp56+S Gufg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=so+gKuUR; 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 b4si23159652pfj.16.2019.04.25.07.08.50; Thu, 25 Apr 2019 07:09:06 -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=so+gKuUR; 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 S1726336AbfDYMqK (ORCPT + 99 others); Thu, 25 Apr 2019 08:46:10 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:39834 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbfDYMqK (ORCPT ); Thu, 25 Apr 2019 08:46:10 -0400 Received: by mail-lf1-f65.google.com with SMTP id d12so17408790lfk.6 for ; Thu, 25 Apr 2019 05:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tpwgTt2BmSUg0ivYIfToBDS6B13YYAHn04kCE0XlNQA=; b=so+gKuURCeQFiWsv96S/x774uD3lKU56jKAnTb1iCRpqbFu/RQF2DjTQXdnbDAadmD iNopgteleUV6c/+3PQS5Pgf2TYgr63CQOpZwqTSuyRy0BMbzmj4sDHq5+zSV6hPUkG0M vtgMicXFjpj/AnZRWi5qG8b9pcZ17I3C+5JEFO2DpWkZ6nY7H5mFtV5JTP1w3mvhBrnf Y4BAkLbvUfUv3wTyZEl9fqwpTAW82V6YYapHUA30/3r9DalHVU9hMtjmemX7VY2NKBFI ilfNFVfdELUn2OrLNOCkdm/nsbbI+ZJrRRD0TmHZbhTNLqWFvn7bg3TbCex3EoUdRICp sKlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tpwgTt2BmSUg0ivYIfToBDS6B13YYAHn04kCE0XlNQA=; b=hKVVJ7aWtuWLqrO/7Rw+I30QUeiaKe4mqAt6S4Y3Ju4VBCRF8Uy8HwzdzP1/fpXbYb UEPfpQ7uZhmhCaChYdWct0CqLEwLrKPXLL7TxMSLVU/w/Zcjfo3KjNtumTeBF+1cDWJS GuCkUj/WrUvsG4QIL7R8qZUKrPsSpjyL4bPIDVpgbiF5F4Jvp99T5D74joUcCZ2tmCnL z+Hws1ACzGk8cQ/+hdO2tOg26iDwX3pzk3pGReD4WMZ6M7Rll9hkaBVB20iKT3tnn/QY UFt/LDNFKNiFr2oknLOh7OFhs0lSsvnTphS9UdtJfxn/C9ZypipzYB0isumdB06zxnrG O0KA== X-Gm-Message-State: APjAAAWAjmp2ULUBBmuVmg7GWDrhzMD9jeHQX7lW+Sv48F59lkBcU2ZC shH/DtoxlpVxXrnTg35Zb23Ub3AkC0gbBmXdv7W2Zw== X-Received: by 2002:a19:7005:: with SMTP id h5mr20392409lfc.143.1556196368332; Thu, 25 Apr 2019 05:46:08 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20190425105658.q45cmfogrt6wwtih@queper01-ThinkPad-T460s> From: Vincent Guittot Date: Thu, 25 Apr 2019 14:45:57 +0200 Message-ID: Subject: Re: [PATCH V2 1/3] Calculate Thermal Pressure To: Quentin Perret 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Thanks, > Quentin