From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8949BC4727F for ; Fri, 25 Sep 2020 10:58:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2581421D91 for ; Fri, 25 Sep 2020 10:58:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vRrDqE9P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbgIYK6j (ORCPT ); Fri, 25 Sep 2020 06:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727495AbgIYK6i (ORCPT ); Fri, 25 Sep 2020 06:58:38 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7A45C0613D3 for ; Fri, 25 Sep 2020 03:58:38 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id v14so1569237pjd.4 for ; Fri, 25 Sep 2020 03:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oAJrRFkjqiZjslJYlYFWCtkiFMgZCCH4FGFRNUlNi2M=; b=vRrDqE9P0tnL8nDtFvM0Q367Z5ymCaxjktdq5fuZXjTDLvHEZSytN4AIovAUQ86Ngf MFSf1MZNGY8+MRU3tuxCFlaKS/qQwMoqCe6gWMZGJGFZ0mTg7IiCW4c+qydrR6yszK01 syhjxFQO6NbzbcCNUzEsW9fCvD44j+0iqI40DW5HUf/C7LjVMGrPGiMWE38ds8ZCwb+h Nms/SLE2q8Hjdmcgy8Sw2eeACFuzinCv2Xcc0l6HXO3DX2OTg0Kjxv81J+2fBjMIks+N yzoaXKqzRt4Zy3uIVkkeTgb1Y+JbW0onSo8SpqtUyIsjIWpHR2z4iNnIU4UeReWlBgFu 4L5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oAJrRFkjqiZjslJYlYFWCtkiFMgZCCH4FGFRNUlNi2M=; b=qBvI1ObfdKYa/RCDXSkzL+YbpkPJJ+2WDk07FFsWy7ZL7c1ziA5ZArtfay/GO1mJz8 JHQByPnC8fTqdJ4cu+RlDUXdCQA6O0JF4CL6h9+zY0wSs+UptghYf1RZvDzcqpyHe1m/ lyo+VVBEzwLHfGfDInMWKihjpHk2ar8Gu3RTEw8gt6gFRytIgy7Ytm4/sCjOqp2xUn/4 d1tb+BF4qUSmXuhkXbUmUhgo+/4rOwYACoic5WufpPRNXEa9d2CbbrbPB18A9taDRfGI AINK0wcCPYNvVXu3H+OcQCie6cGGGNe47/9DIFVg1GwYiLeo81nuxG3sDNRmerZqK8vl 7j8A== X-Gm-Message-State: AOAM531i3qHoxg6YdXFxMfJfEDlyvqQ7iEfMKDvZgOr5xW9Wtv9iiheU iCgIpliqjPhAhX+XOaBwkiOB6g== X-Google-Smtp-Source: ABdhPJwZFpFShelf2IuBLECWnc8DtK9yg/mtTTI8N/aWHMtli1doBnI/KO23D/dvCAYIQu2DZz26Sw== X-Received: by 2002:a17:90b:1649:: with SMTP id il9mr2115322pjb.50.1601031518092; Fri, 25 Sep 2020 03:58:38 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id w19sm2384717pfq.60.2020.09.25.03.58.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2020 03:58:37 -0700 (PDT) Date: Fri, 25 Sep 2020 16:28:30 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Rafael Wysocki , Linux PM , Vincent Guittot , Lukasz Luba , cristian.marussi@arm.com, Sudeep Holla , Linux Kernel Mailing List Subject: Re: [PATCH V2 1/4] cpufreq: stats: Defer stats update to cpufreq_stats_record_transition() Message-ID: <20200925105830.xsmiwkjohlqb5joj@vireshk-i7> References: <31999d801bfb4d8063dc1ceec1234b6b80b4ae68.1600238586.git.viresh.kumar@linaro.org> <20200924131543.eury5vhqy3xt35v6@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-09-20, 12:04, Rafael J. Wysocki wrote: > I'm actually wondering if reset_time is necessary at all. > > If cpufreq_stats_record_transition() is the only updater of the stats, > which will be the case after applying this series IIUC, it may as well > simply set the new starting point and discard all of the data > collected so far if reset_pending is set. > > IOW, the time when the reset has been requested isn't particularly > relevant IMV (and it is not exact anyway), because the user is > basically asking for discarding "history" and that may very well be > interpreted to include the current sample. There are times when this would be visible to userspace and won't look nice. Like, set governor to performance, reset the stats and after 10 seconds, read the stats again, everything will be 0. Because cpufreq_stats_record_transition() doesn't get called at all here, we would never clear them until the time governor is changed and so we need to keep a track of reset-time. -- viresh