* [PATCH v1] hw/cxl: Fix background completion percentage calculation
@ 2024-09-14 11:20 ajay.opensrc
2024-10-14 10:12 ` Jonathan Cameron via
0 siblings, 1 reply; 3+ messages in thread
From: ajay.opensrc @ 2024-09-14 11:20 UTC (permalink / raw)
To: mst
Cc: Jonathan.Cameron, john, emirakhur, ajayjoshi, sthanneeru,
Ravis.OpenSrc, arramesh, dave, qemu-devel, linux-cxl, Ajay Joshi
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>
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);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] hw/cxl: Fix background completion percentage calculation
2024-09-14 11:20 [PATCH v1] hw/cxl: Fix background completion percentage calculation ajay.opensrc
@ 2024-10-14 10:12 ` Jonathan Cameron via
2024-10-14 10:48 ` [EXT] " ajay.opensrc
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron via @ 2024-10-14 10:12 UTC (permalink / raw)
To: ajay.opensrc
Cc: mst, john, emirakhur, ajayjoshi, sthanneeru, Ravis.OpenSrc,
arramesh, dave, qemu-devel, linux-cxl
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);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [EXT] Re: [PATCH v1] hw/cxl: Fix background completion percentage calculation
2024-10-14 10:12 ` Jonathan Cameron via
@ 2024-10-14 10:48 ` ajay.opensrc
0 siblings, 0 replies; 3+ messages in thread
From: ajay.opensrc @ 2024-10-14 10:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: mst@redhat.com, john@jagalactic.com, Eishan Mirakhur, Ajay Joshi,
Srinivasulu Thanneeru, Ravis OpenSrc, Aravind Ramesh,
dave@stgolabs.net, qemu-devel@nongnu.org,
linux-cxl@vger.kernel.org
>On Mon, 14 Oct 2024 10:32 +0530
><Jonathan.Cameron@Huawei.com> wrote:
>
>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! Got it.
Sorry missed the versioning, will be more careful about it.
>
>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);
>> }
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-14 10:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14 11:20 [PATCH v1] hw/cxl: Fix background completion percentage calculation ajay.opensrc
2024-10-14 10:12 ` Jonathan Cameron via
2024-10-14 10:48 ` [EXT] " ajay.opensrc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).