4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-08 18:19:08 +08:00
Mark Geisert c18037074c
Cygwin: Minor updates to load average calculations
Commentary wording now refers to tasks (i.e., threads) rather than
processes.  This makes it somewhat easier to justify adding two kinds of
counters together.  After researching what "load average" has meant over
time, we have what seems like a reasonable implementation, modulo
Windows differences to Linux.  The best resource I found is:
https://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

At end of load_init(), obtain and discard the first measure of the
counters to deal with the first call always returning error, no data.
Follow this with a specific short delay so the next measure actually has
data to report.

At least one older version of Windows, i.e. Win10 Pro 21H1, has a different
name/location for the '% Processor Time' counter and is missing the
'Processor Queue Length' counter entirely.  Code is changed to support
both possible locations of the former and treat the missing latter as always
reporting 0.0.

A release note is added for 3.5.6.

Reported-by: Mark Liam Brown <brownmarkliam@gmail.com>
Addresses: https://cygwin.com/pipermail/cygwin/2024-August/256361.html
Signed-off-by: Mark Geisert <mark@maxrnd.com>
Fixes: 4dc982ddf60b (Cygwin: loadavg: improve debugging of load_init)
(cherry picked from commit 0135b94949d2c9ba0b0f839fae8ff49a5bfe8589)
2025-01-23 12:53:37 +00:00
..
2024-09-12 10:57:24 -04:00

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Cygwin documentation is available on the net at https://cygwin.com
You might especially be interested in

https://cygwin.com/faq/faq.html#faq.programming.building-cygwin