File s390-tools-sles15sp3-hyptop-increase-initial-update-interval.patch of Package s390-tools.28664

Subject: [PATCH] [BZ 198756] hyptop: increase initial update interval
From: Mete Durlu <meted@linux.ibm.com>

Description:   hyptop: observable value fluctuations on initial iteration
Symptom:       Initial iteration of hyptop can produce bloated values
               independent from the update delay set by the user.
Problem:       In order to be responsive and produce an output as soon as
               possible, hyptop fetches data in a very short interval for the
               very first iteration. This can, in rare cases, cause
               instabilities in data which produces bloated values.
Solution:      Increase update delay on first iteration.
Reproduction:  Since it is a rare occuring event, fastest way to observe the
               issue would be, setting iteration number (-n) to 1 and calling
               hyptop in a loop. Example in bash:
                ```
                for ((;;))
                do
                        hyptop -n 1 -b
                done
                ```
Upstream-ID:   80e54ac888d6232d99a485c74071fc2173f3dfbf
Problem-ID:    198756

Upstream-Description:

              hyptop: increase initial update interval

              Increase initial update interval from 200ms to 1 seconds to avoid
              fluctuations on the initial data output.

              Signed-off-by: Mete Durlu <meted@linux.ibm.com>
              Signed-off-by: Jan Hoeppner <hoeppner@linux.ibm.com>


Signed-off-by: Mete Durlu <meted@linux.ibm.com>
---
 hyptop/sd.h      |    2 +-
 hyptop/sd_core.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/hyptop/sd.h
+++ b/hyptop/sd.h
@@ -17,7 +17,7 @@
 #include "helper.h"
 #include "table.h"
 
-#define SD_DG_INIT_INTERVAL_MS	200
+#define SD_DG_INIT_INTERVAL_SEC	1
 #define SD_SYS_ID_SIZE		9
 
 /*
--- a/hyptop/sd_core.c
+++ b/hyptop/sd_core.c
@@ -150,7 +150,7 @@ void sd_update(void)
  */
 void sd_dg_register(struct sd_dg *dg, int has_core_data)
 {
-	struct timespec ts = {0, SD_DG_INIT_INTERVAL_MS * 1000000};
+	struct timespec ts = {SD_DG_INIT_INTERVAL_SEC, 0};
 	struct sd_sys_item *sys_item;
 	struct sd_cpu_item *cpu_item;
 	unsigned int i;
openSUSE Build Service is sponsored by