public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/cxl: Fix background completion percentage calculation
@ 2024-07-29 10:23 ajay.opensrc
  2024-07-30  5:24 ` Davidlohr Bueso
  2024-09-10 17:07 ` Michael S. Tsirkin
  0 siblings, 2 replies; 6+ messages in thread
From: ajay.opensrc @ 2024-07-29 10:23 UTC (permalink / raw)
  To: Jonathan.Cameron
  Cc: linux-cxl, john, emirakhur, ajayjoshi, sthanneeru, ravis.opensrc,
	arramesh, 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>
---
 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] 6+ messages in thread

* Re: [PATCH] hw/cxl: Fix background completion percentage calculation
  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-09-10 17:07 ` Michael S. Tsirkin
  1 sibling, 1 reply; 6+ messages in thread
From: Davidlohr Bueso @ 2024-07-30  5:24 UTC (permalink / raw)
  To: ajay.opensrc
  Cc: Jonathan.Cameron, linux-cxl, john, emirakhur, ajayjoshi,
	sthanneeru, ravis.opensrc, arramesh

On Mon, 29 Jul 2024, ajay.opensrc@micron.com wrote:\n
>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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [EXT] Re: [PATCH] hw/cxl: Fix background completion percentage calculation
  2024-07-30  5:24 ` Davidlohr Bueso
@ 2024-08-27 16:01   ` ajay.opensrc
  2024-08-27 16:38     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: ajay.opensrc @ 2024-08-27 16:01 UTC (permalink / raw)
  To: Jonathan.Cameron@huawei.com
  Cc: linux-cxl@vger.kernel.org, john@jagalactic.com, Eishan Mirakhur,
	Ajay Joshi, Srinivasulu Thanneeru, Ravis OpenSrc, Aravind Ramesh,
	Davidlohr Bueso, qemu-devel@nongnu.org

> From: Davidlohr Bueso <dave@stgolabs.net>
> 
> On Mon, 29 Jul 2024, ajay.opensrc@micron.com wrote:\n
> >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>

Ping.
Jonathan, this patch was reviewed by Dave already.
Do you have any comments on this patch?

Ajay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [EXT] Re: [PATCH] hw/cxl: Fix background completion percentage calculation
  2024-08-27 16:01   ` [EXT] " ajay.opensrc
@ 2024-08-27 16:38     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2024-08-27 16:38 UTC (permalink / raw)
  To: ajay.opensrc
  Cc: linux-cxl@vger.kernel.org, john@jagalactic.com, Eishan Mirakhur,
	Ajay Joshi, Srinivasulu Thanneeru, Ravis OpenSrc, Aravind Ramesh,
	Davidlohr Bueso, qemu-devel@nongnu.org, Michael S. Tsirkin

On Tue, 27 Aug 2024 16:01:54 +0000
ajay.opensrc <ajay.opensrc@micron.com> wrote:

> > From: Davidlohr Bueso <dave@stgolabs.net>
> > 
> > On Mon, 29 Jul 2024, ajay.opensrc@micron.com wrote:\n  
> > >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>  
> 
> Ping.
> Jonathan, this patch was reviewed by Dave already.
> Do you have any comments on this patch?

Sorry bit behind. Seems fine to me.   I'll queue it up, but not sure
when I'll get a fixes series out (hopefully soon!)

+CC Michael in meantime.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
in case Michael wants to pick it up directly.

Thanks,

Jonathan

> 
> Ajay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hw/cxl: Fix background completion percentage calculation
  2024-07-29 10:23 [PATCH] hw/cxl: Fix background completion percentage calculation ajay.opensrc
  2024-07-30  5:24 ` Davidlohr Bueso
@ 2024-09-10 17:07 ` Michael S. Tsirkin
  2024-09-14 11:29   ` [EXT] " ajay.opensrc
  1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2024-09-10 17:07 UTC (permalink / raw)
  To: ajay.opensrc
  Cc: Jonathan.Cameron, linux-cxl, john, emirakhur, ajayjoshi,
	sthanneeru, ravis.opensrc, arramesh

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
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [EXT] Re: [PATCH] hw/cxl: Fix background completion percentage calculation
  2024-09-10 17:07 ` Michael S. Tsirkin
@ 2024-09-14 11:29   ` ajay.opensrc
  0 siblings, 0 replies; 6+ messages in thread
From: ajay.opensrc @ 2024-09-14 11:29 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jonathan.Cameron@huawei.com, linux-cxl@vger.kernel.org,
	john@jagalactic.com, Eishan Mirakhur, Ajay Joshi,
	Srinivasulu Thanneeru, Ravis OpenSrc, Aravind Ramesh



>From: Michael S. Tsirkin <mst@redhat.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.

I have resent the patch with the all the tags Michael.
https://lore.kernel.org/linux-cxl/20240914112021.2730383-1-ajay.opensrc@micron.com/T/#u

>
>> ---
>>  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	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-14 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-09-14 11:29   ` [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