Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp321082yba; Fri, 26 Apr 2019 00:10:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqySqBRcjL68ZmO/eS/06FIOJZWkP4928aSotk0RzYcEOfWEbMark39Wl5bNF3hC14H3am/+ X-Received: by 2002:a63:6e09:: with SMTP id j9mr42323777pgc.416.1556262602369; Fri, 26 Apr 2019 00:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556262602; cv=none; d=google.com; s=arc-20160816; b=fXAC0jXttoni8YKApIpbFodLZmNVyXe6O7UxE3fT28aAgQwdcNlTM/h0p/s6p//wUb VPiNGCc4UxUqeGVqKb6kcn30V4DHWv0XicIsQJ0FdHHVKNxX0RYPIgAglvR/sTBXRvF+ mSXtEGQD9mPJAw+R+/9JUwMqSGdQhsNvt1OZVRXL8bumRdOj2lJuvNU20xLxBygD+h/q uur9Wf7dc5UzT9T535DnuqbOovM3KrcvIFmDRBySJKaMEoQ+bRs4voEM2uFvp6wvAr6j pTq7M+DxKDCTlfUYFyF2JfVSfEQYd3Gus2Y++zhQQ2t4qS54cLSV+OQCkQBbPFwyAk3x dYAw== 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=LXrFXB2NzklWq6nejt9rEAAWErabyL0mpEfbi7YUPJQ=; b=aiBix+cgsXTr1vXeXL/v5AFfKEW5iMXCy/oEd8pSeNz7A4t2/j0rr7pnOGno3+35XD nQuv/UiKFhJKa0JGj9Rd0edtDZ5mfU6y507Aa1sCrWHjHPgmk2+5+hkKp8fEcS+R7Dfn JXwqdkNn7HIpLVu7ugJyQJYVfmbYfwVe4N+tfxfEoeIdfl5oH+acyiVLge1HTDDtu/N0 fUQzwyxWaDlYIG7jTRqTnulEFuNB+1c3wA7RTd52dsGUnlmRb+E9vFlbOofDyOKnITPi DhXGpxcC8fQo7G+Uvm2tnu3SdeNaeT1jfLg4bY5vdVCtPaHiPfAAcTH4KSBLE9ioE5Mz ImTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NIQCHSxv; 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 r10si22870847pgp.30.2019.04.26.00.09.46; Fri, 26 Apr 2019 00:10:02 -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=NIQCHSxv; 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 S1726058AbfDZHIn (ORCPT + 99 others); Fri, 26 Apr 2019 03:08:43 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37949 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfDZHIn (ORCPT ); Fri, 26 Apr 2019 03:08:43 -0400 Received: by mail-lf1-f66.google.com with SMTP id v1so1677667lfg.5 for ; Fri, 26 Apr 2019 00:08:42 -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=LXrFXB2NzklWq6nejt9rEAAWErabyL0mpEfbi7YUPJQ=; b=NIQCHSxvxTKsbDwGB2MVJmn1q9VNAV4YaA8r48nrEyBAAasITPzSo8m22+dn7wdCXO B/59n9LwS1KafALy7RrzGrIAqySMfP8KhU+8cIpWHKcAhxeifWuKwceW8WUEbKgHVPyc 5uOwA2hWaiY9ACnQPeZszpSEqBnvpUUmFO1+mUoaRJ/dzMqaViEWJh8nB77TVj7qEh+6 nS/4Mpqr0cMX7eSRI09mBAktSjTLv2/MtuiY054dxIY3p2K9YhKeRarYMwge4x5Fcwkg okHNTNEWmWBp4ZeMeCRFboimDVOvf2mkdWrbJvAf1DBSRrCw7UAtyBMCJocRXdgCfFmU SJXA== 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=LXrFXB2NzklWq6nejt9rEAAWErabyL0mpEfbi7YUPJQ=; b=dgiUu+fFipmLTG0hMx4bMw5PI7ZV2d5N66OHulSpOJx8nQUuIzCSVDoRj2Vxw+UE2Z 5iczYDdKfto6g+XSqsM+m3B8CNolfcDN/mZtFUDySg4EjuBW6cH7FBfJRjLM+74YIGiM ti+FoJTZSh8KEHcYHNwIe0HUoxth2u6xZMiX5u8WHZDyAF9WbYvSgkJCmb8o6kcRNw4G Ib/FL/v3Dsxvj+iiSDXJF7GR2Q3kEVlAXmzAq6yUnxJQLAyXLa0sxzsEMI3Ix/obIH5h /H+UlaUh9ChmoWgID7b49ATbF3UrbQkJ8msW1s7rsIn0ynDOmxc2vlw32x57IM8r0P1w EdoA== X-Gm-Message-State: APjAAAVnzt9MIWCtcJwC2Kucfk60dHJxfc9iQYS3miLJRsGswJobbwT7 eNsMtksyhWHotTK7jAiKzxAfSmTouGy7YTFDPAQNEw== X-Received: by 2002:ac2:4301:: with SMTP id l1mr7431299lfh.54.1556262521194; Fri, 26 Apr 2019 00:08:41 -0700 (PDT) MIME-Version: 1.0 References: <1555443521-579-1-git-send-email-thara.gopinath@linaro.org> <20190417053626.GA47282@gmail.com> <5CB75FD9.3070207@linaro.org> <20190417182932.GB5140@gmail.com> <20190424163424.GG4038@hirez.programming.kicks-ass.net> <20190425173333.GA4081@gmail.com> <20190425174425.GA121124@gmail.com> In-Reply-To: <20190425174425.GA121124@gmail.com> From: Vincent Guittot Date: Fri, 26 Apr 2019 09:08:29 +0200 Message-ID: Subject: Re: [PATCH V2 0/3] Introduce Thermal Pressure To: Ingo Molnar Cc: Peter Zijlstra , Thara Gopinath , Ingo Molnar , Zhang Rui , linux-kernel , Amit Kachhap , viresh kumar , Javi Merino , Eduardo Valentin , Daniel Lezcano , Nicolas Dechesne , Bjorn Andersson , Dietmar Eggemann , Quentin Perret , "Rafael J. Wysocki" 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 19:44, Ingo Molnar wrote: > > > * Ingo Molnar wrote: > > > > > * Peter Zijlstra wrote: > > > > > On Wed, Apr 17, 2019 at 08:29:32PM +0200, Ingo Molnar wrote: > > > > Assuming PeterZ & Rafael & Quentin doesn't hate the whole thermal load > > > > tracking approach. > > > > > > I seem to remember competing proposals, and have forgotten everything > > > about them; the cover letter also didn't have references to them or > > > mention them in any way. > > > > > > As to the averaging and period, I personally prefer a PELT signal with > > > the windows lined up, if that really is too short a window, then a PELT > > > like signal with a natural multiple of the PELT period would make sense, > > > such that the windows still line up nicely. > > > > > > Mixing different averaging methods and non-aligned windows just makes me > > > uncomfortable. > > > > Yeah, so the problem with PELT is that while it nicely approximates > > variable-period decay calculations with plain additions, shifts and table > > lookups (i.e. accelerates pow()), AFAICS the most important decay > > parameter is fixed: the speed of decay, the dampening factor, which is > > fixed at 32: > > > > Documentation/scheduler/sched-pelt.c > > > > #define HALFLIFE 32 > > > > Right? > > > > Thara's numbers suggest that there's high sensitivity to the speed of > > decay. By using PELT we'd be using whatever averaging speed there is > > within PELT. > > > > Now we could make that parametric of course, but that would both > > complicate the PELT lookup code (one more dimension) and would negatively > > affect code generation in a number of places. > > I missed the other solution, which is what you suggested: by > increasing/reducing the PELT window size we can effectively shift decay > speed and use just a single lookup table. > > I.e. instead of the fixed period size of 1024 in accumulate_sum(), use > decay_load() directly but use a different (longer) window size from 1024 > usecs to calculate 'periods', and make it a multiple of 1024. Can't we also scale the now parameter of ___update_load_sum() ? If we right shift it before calling ___update_load_sum, it should be the same as using a half period of 62, 128, 256ms ... The main drawback would be a lost of precision but we are in the range of 2, 4, 8us compared to the 1ms window This is quite similar to how we scale the utilization with frequency and uarch > > This might just work out right: with a half-life of 32 the fastest decay > speed should be around ~20 msecs (?) - and Thara's numbers so far suggest > that the sweet spot averaging is significantly longer, at a couple of > hundred millisecs. > > Thanks, > > Ingo