Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lparstat: Use CLOCK_BOOTTIME for get_time interface and Deprecate get…
…_sys_upttime "time" is used in lparstat.c to find the time elapsed either since boot or between two intervals. But it is using gettimeofday which returns the time elapsed since Epoch. This works for intervals calculations but it doesn't work for since boot reports. Instead use the CLOCK_BOOTTIME interface to get the elapsed time. This fixes physc, utilization based on purr being wrong since boot. Remove "uptime" interface since there are no users of it. One can get the system uptime by calling "time" itself. =============================== ::Test:: ========================== reboot stress-ng --cpu=$(nproc) -t 600 sleep 600 Results:: ==================== Shared LPAR ================================== System Configuration type=Shared mode=Uncapped smt=8 lcpu=12 mem=15573440 kB cpus=37 ent=12.00 lparstat -E <-- Observe utilization values ====== 6.9-rc1 and lparstat 1.3.10 ============= ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 0.00 0.00 3.87GHz[106%] 0.00 0.00 ==== With this patch and patch 2/3 ============= ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 38.72 0.11 3.87GHz[106%] 41.04 0.12 lparstat <-- Observe physc values ====== 6.9-rc1 and lparstat 1.3.10 =================================== %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 47.48 0.01 0.00 52.51 0.00 0.00 47.49 69099.72 541547 21 === With this patch and this patch ================================ === %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 47.48 0.01 0.00 52.51 5.73 47.75 47.49 31.21 541753 21 ==================== Dedicated LPAR ================================== System Configuration type=Dedicated mode=Capped smt=8 lcpu=12 mem=15573248 kB cpus=0 ent=12.00 ::lparstat -E:: <-- Observe utilization values. ======= 6.9-rc1 and lparstat 1.3.10 ============= ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 0.00 0.00 3.87GHz[106%] 0.00 0.00 === With this patch and powerpc-utils patch to do the above equation === ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 48.87 51.51 3.87GHz[106%] 51.81 54.60 ::lparstat:: <-- Observe physc values. ======= 6.9-rc1 and lparstat 1.3.10 ============= %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 48.38 0.01 0.00 51.61 0.03 0.25 48.39 0.00 344661 8 === With this patch and powerpc-utils patch to do the above equation === %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 48.38 0.01 0.00 51.61 12.05 100.42 48.39 0.00 344877 8 ============================================================================= Interval based lparstat values are same. With this patch the physc and busy purr/idle purr values show correctly for since boot reports. Note: this patch doesn't fix the idle purr being incorrect. That is currently being investigated. Signed-off-by: Shrikanth Hegde <[email protected]> Signed-off-by: Tyrel Datwyler <[email protected]>
- Loading branch information