Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp39433pxb; Fri, 17 Sep 2021 18:06:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv3ulHi6wT7R/m+FvX5yFP6v1CrURQdlxGI3E/7gvzhAhqfHWiEQe4Hbw9WtP8Vjf8JjJk X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr15126967ejb.401.1631927180333; Fri, 17 Sep 2021 18:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631927180; cv=none; d=google.com; s=arc-20160816; b=tO4CndZFVrfTRuzdthEM+rGaZiulgJ9VWn9/akJ4aZNYp+E1ZHv7Wi5uRzRIp9sv6/ lVn50j786gssbGXVr9AnL/PCJYOVSH/mGQoLw6j0zuHZ4kkxpW4UscJWXEsHxBNfU7Bi zYnjIBdKUZvjWnfgBU+xcKooLrmh3WXpl0IWpESBfBUGat6QsMlTHnPlrYJftygONqP2 mBgkJIITx8attNGmZgIPCVno4Mjj9TLNrkTPWGUcu2dlkBFAo9uclqlIzgAU95LYC2hv eD/veymV2AyAo65is7P/Ob2VZNwW/hCbf6U9DDaxf7VqFyidxHPIxP9lyBgtDAN9nxxj i0WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=PeLCSRTp6fxQ8EfepfAcSz5knhvtH4YesDFa1AvXuE4=; b=qXDuvvlYlTllDpxwCmgppJ+h2L2NqrCe+LTCIceBfmYs0D2Hq0j43Jfm1+fi9gQ/AY vKNecAIZjX1jLMuheGLK7N1XPoccTQnNM4msskGlNVJXoOWGzZaSzjO/n+USGfPd5JOR 6wBNF/6gJQuFb9X3kJ4do2OzfosU13fdnRw+E/GC7cCLFh4Lxs4Md4fDZbMPtgWb1SHa cxH+d7BDBuLeWGM7UhYOzsYHJ/bRWLcGldfZpE9g2EG64+3zz11oo2hMd8lTnrxiwsVV osDqBcYEf+GXg3ZjwmeeaTrnORqRauW89dW4z2eBSDyn21esc7cbd2rzYRhgGMa2HPre Xdxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si8959948eji.707.2021.09.17.18.05.57; Fri, 17 Sep 2021 18:06:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343837AbhIQQ7q (ORCPT + 99 others); Fri, 17 Sep 2021 12:59:46 -0400 Received: from foss.arm.com ([217.140.110.172]:55646 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245434AbhIQQ7d (ORCPT ); Fri, 17 Sep 2021 12:59:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6F6F1063; Fri, 17 Sep 2021 09:58:10 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A69823F59C; Fri, 17 Sep 2021 09:58:08 -0700 (PDT) From: James Morse Subject: Re: [PATCH v1 11/20] x86/resctrl: Calculate bandwidth from the total bytes counter To: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com, bobo.shaobowang@huawei.com References: <20210729223610.29373-1-james.morse@arm.com> <20210729223610.29373-12-james.morse@arm.com> <15febd4d-11d9-8456-60ee-994e66efdc98@intel.com> Message-ID: Date: Fri, 17 Sep 2021 17:58:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <15febd4d-11d9-8456-60ee-994e66efdc98@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 01/09/2021 22:31, Reinette Chatre wrote: > Apologies but I find the changelog hard to understand. No problem, clearly room for improvement! > On 7/29/2021 3:36 PM, James Morse wrote: >> mbm_bw_count() maintains its own copy of prev_msr to allow it to >> calculate the bandwidth as the number of chunks counted since the >> last time mbm_bw_count() was invoked. > > ok, I understand there is an extra copy The point I was trying to get across here is mbm_bw_count() is holding a hardware value, which means it isn't architecture agnostic. Calculating bytes first paves the way to using an arch helper that returns bytes. This was originally later in the series, and it looks like it got damaged during a rebase. I've rewritten it to calculate bandwidth based on the value read by the previous __mon_event_count(), this is simpler and less noisy for the rest of the series. Thanks, James