hw/cxl: Fix background completion percentage calculation
PATCH 1/1 hw/cxl: Fix background completion percentage calculation
From: Ajay Joshi <[email protected]>
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.
--- hw/cxl/cxl-mailbox-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/cxl/cxl-mailbox-utils.c +2 -1
@@ -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 ); }
Signature · 1 line
2.34.1
On Mon, 29 Jul 2024, [email protected] wrote:\n
Quoted 8 lines
From: Ajay Joshi <[email protected]>
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.
Quoted 6 lines
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 <[email protected]>
Quoted 12 lines
From: Davidlohr Bueso <[email protected]>
On Mon, 29 Jul 2024, [email protected] wrote:\n
Quoted 9 lines
From: Ajay Joshi <[email protected]>
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.
Quoted 6 lines
Quoted 4 lines
Fixes 221d2cfbdb ("hw/cxl/mbox: Add support for backgroundoperations")
Signed-off-by Ajay Joshi <[email protected]>Reviewed-by Davidlohr Bueso <[email protected]>
Ping.
Jonathan, this patch was reviewed by Dave already. Do you have any comments on this patch?
Ajay
Jonathan Cameron
Acked-byQuoted 15 lines · On Tue, 27 Aug 2024 16:01:54 +0000 ajay.opensrc <[email protected]> wrote:
Quoted 15 lines
From: Davidlohr Bueso <[email protected]>
On Mon, 29 Jul 2024, [email protected] wrote:\n
Quoted 12 lines
From: Ajay Joshi <[email protected]>
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 backgroundoperations")
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Ajay Joshi <[email protected]>Reviewed-by Davidlohr Bueso <[email protected]>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.
in case Michael wants to pick it up directly.
Thanks,
Jonathan
Quoted 2 lines
Ajay
Quoted 8 lines · On Mon, Jul 29, 2024 at 03:53:38PM +0530, [email protected] wrote:
From: Ajay Joshi <[email protected]>
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.
Quoted 6 lines
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 <[email protected]>
Keep all tags together with no empty lines pls.
Quoted 21 lines
--- hw/cxl/cxl-mailbox-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)hw/cxl/cxl-mailbox-utils.c +2
-1@@ -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 ); }Signature · 1 line
2.34.1
Quoted 12 lines
From: Michael S. Tsirkin <[email protected]>
Quoted 8 lines · On Mon, Jul 29, 2024 at 03:53:38PM +0530, [email protected] wrote:
From: Ajay Joshi <[email protected]>
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.
Quoted 8 lines
Quoted 6 lines
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 <[email protected]>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/[email protected]/T/#u
Quoted 21 lines
Quoted 21 lines
--- hw/cxl/cxl-mailbox-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)hw/cxl/cxl-mailbox-utils.c +2
-2@@ -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