public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: ajay.opensrc@micron.com
Cc: Jonathan.Cameron@huawei.com, linux-cxl@vger.kernel.org,
	john@jagalactic.com, emirakhur@micron.com, ajayjoshi@micron.com,
	sthanneeru@micron.com, ravis.opensrc@micron.com,
	arramesh@micron.com
Subject: Re: [PATCH] hw/cxl: Fix background completion percentage calculation
Date: Tue, 10 Sep 2024 13:07:57 -0400	[thread overview]
Message-ID: <20240910130723-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20240729102338.22337-1-ajay.opensrc@micron.com>

On Mon, Jul 29, 2024 at 03:53:38PM +0530, ajay.opensrc@micron.com wrote:
> From: Ajay Joshi <ajayjoshi@micron.com>
> 
> The current completion percentage calculation
> does not account for the relative time since
> the start of the background activity, this leads
> to showing incorrect start percentage vs what has
> actually been completed.
> 
> This patch calculates the percentage based on the actual
> elapsed time since the start of the operation.
> 
> Fixes: 221d2cfbdb ("hw/cxl/mbox: Add support for background operations")
> 
> Signed-off-by: Ajay Joshi <ajay.opensrc@micron.com>

Keep all tags together with no empty lines pls.

> ---
>  hw/cxl/cxl-mailbox-utils.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
> index c2ed251bb3..873d60c069 100644
> --- a/hw/cxl/cxl-mailbox-utils.c
> +++ b/hw/cxl/cxl-mailbox-utils.c
> @@ -2708,7 +2708,8 @@ static void bg_timercb(void *opaque)
>          }
>      } else {
>          /* estimate only */
> -        cci->bg.complete_pct = 100 * now / total_time;
> +        cci->bg.complete_pct =
> +            100 * (now - cci->bg.starttime) / cci->bg.runtime;
>          timer_mod(cci->bg.timer, now + CXL_MBOX_BG_UPDATE_FREQ);
>      }
>  
> -- 
> 2.34.1
> 


  parent reply	other threads:[~2024-09-10 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 10:23 [PATCH] hw/cxl: Fix background completion percentage calculation ajay.opensrc
2024-07-30  5:24 ` Davidlohr Bueso
2024-08-27 16:01   ` [EXT] " ajay.opensrc
2024-08-27 16:38     ` Jonathan Cameron
2024-09-10 17:07 ` Michael S. Tsirkin [this message]
2024-09-14 11:29   ` ajay.opensrc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240910130723-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ajay.opensrc@micron.com \
    --cc=ajayjoshi@micron.com \
    --cc=arramesh@micron.com \
    --cc=emirakhur@micron.com \
    --cc=john@jagalactic.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ravis.opensrc@micron.com \
    --cc=sthanneeru@micron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox