From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: <ajay.opensrc@micron.com>
Cc: <mst@redhat.com>, <john@jagalactic.com>, <emirakhur@micron.com>,
<ajayjoshi@micron.com>, <sthanneeru@micron.com>,
<Ravis.OpenSrc@micron.com>, <arramesh@micron.com>,
<dave@stgolabs.net>, <qemu-devel@nongnu.org>,
<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v1] hw/cxl: Fix background completion percentage calculation
Date: Mon, 14 Oct 2024 11:12:16 +0100 [thread overview]
Message-ID: <20241014111216.000014c2@Huawei.com> (raw)
In-Reply-To: <20240914112021.2730383-1-ajay.opensrc@micron.com>
On Sat, 14 Sep 2024 16:50:21 +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")
>
I'll include this is a fixes series I send to Michael + list later
today. However for future reference, no line break between tags in
the tags block as it breaks some scripting. I'll tidy that up.
Note I think you missed Michael's point about this on the first version.
+ as a second version, even without changes, this should have been v2.
Thanks
Jonathan
> Signed-off-by: Ajay Joshi <ajay.opensrc@micron.com>
> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> 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);
> }
>
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: <ajay.opensrc@micron.com>
Cc: <mst@redhat.com>, <john@jagalactic.com>, <emirakhur@micron.com>,
<ajayjoshi@micron.com>, <sthanneeru@micron.com>,
<Ravis.OpenSrc@micron.com>, <arramesh@micron.com>,
<dave@stgolabs.net>, <qemu-devel@nongnu.org>,
<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v1] hw/cxl: Fix background completion percentage calculation
Date: Mon, 14 Oct 2024 11:12:16 +0100 [thread overview]
Message-ID: <20241014111216.000014c2@Huawei.com> (raw)
In-Reply-To: <20240914112021.2730383-1-ajay.opensrc@micron.com>
On Sat, 14 Sep 2024 16:50:21 +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")
>
I'll include this is a fixes series I send to Michael + list later
today. However for future reference, no line break between tags in
the tags block as it breaks some scripting. I'll tidy that up.
Note I think you missed Michael's point about this on the first version.
+ as a second version, even without changes, this should have been v2.
Thanks
Jonathan
> Signed-off-by: Ajay Joshi <ajay.opensrc@micron.com>
> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> 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);
> }
>
next prev parent reply other threads:[~2024-10-14 10:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 11:20 [PATCH v1] hw/cxl: Fix background completion percentage calculation ajay.opensrc
2024-10-14 10:12 ` Jonathan Cameron [this message]
2024-10-14 10:12 ` Jonathan Cameron via
2024-10-14 10:48 ` [EXT] " 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=20241014111216.000014c2@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=Ravis.OpenSrc@micron.com \
--cc=ajay.opensrc@micron.com \
--cc=ajayjoshi@micron.com \
--cc=arramesh@micron.com \
--cc=dave@stgolabs.net \
--cc=emirakhur@micron.com \
--cc=john@jagalactic.com \
--cc=linux-cxl@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.