linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* schedutil issue with serial workloads
@ 2020-06-04 21:29 Alexander Monakov
  2020-06-05 16:51 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Monakov @ 2020-06-04 21:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rafael J. Wysocki

Hello,

this is a question/bugreport about behavior of schedutil on serial workloads
such as rsync, or './configure', or 'make install'. These workloads are
such that there's no single task that takes a substantial portion of CPU
time, but at any moment there's at least one runnable task, and overall
the workload is compute-bound. To run the workload efficiently, cpufreq
governor should select a high frequency.

Assume the system is idle except for the workload in question.

Sadly, schedutil will select the lowest frequency, unless the workload is
confined to one core with taskset (in which case it will select the
highest frequency, correctly though somewhat paradoxically).

This sounds like it should be a known problem, but I couldn't find any
mention of it in the documentation.

I was able to replicate the effect with a pair of 'ping-pong' programs
that get a token, burn some cycles to simulate work, and pass the token.
Thus, each program has 50% CPU utilization. To repeat my test:

gcc -O2 pingpong.c -o pingpong
mkfifo ping
mkfifo pong
taskset -c 0 ./pingpong 1000000 < ping > pong &
taskset -c 1 ./pingpong 1000000 < pong > ping &
echo > ping

#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
	unsigned i, n;
	sscanf(argv[1], "%u", &n);
	for (;;) {
		char c;
		read(0, &c, 1);
		for (i = n; i; i--)
			asm("" :: "r"(i));
		write(1, &c, 1);
	}
}

Alexander

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

end of thread, other threads:[~2020-06-07 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 21:29 schedutil issue with serial workloads Alexander Monakov
2020-06-05 16:51 ` Rafael J. Wysocki
2020-06-05 18:35   ` Alexander Monakov
2020-06-05 20:33   ` Peter Zijlstra
2020-06-07 17:24   ` Doug Smythies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).