I FIXED AMD's Preferred Core Linux patch to FINALLY work for HIGHER BOOST and PERFORMANCE !

trclst@lemmy.ml to Linux@lemmy.ml – 264 points –
I FIXED AMD's Preferred Core Linux patch to FINALLY work for HIGHER BOOST and PERFORMANCE !
youtube.com
20

You are viewing a single comment

Apparently there's a bug in an AMD's driver. It was supposed to assign processes based on each core's self reported performance, but because of the bug it was random.

This "self reported performance" is based on evaluation done to the cores in the fab process, by AMD. Meaning, due to imperfections some cores are a bit better than others.

It's not just random, it simply does not even work. Because they set this:

+/*Preferred Core featue is supported*/
+static bool prefcore = true;

And later in the code they do the if condition wrong:

+	if (prefcore)
+		WRITE_ONCE(cpudata->highest_perf, AMD_PSTATE_PREFCORE_THRESHOLD);
+	else
+		WRITE_ONCE(cpudata->highest_perf, AMD_CPPC_HIGHEST_PERF(cap1));

if should look like this:

+	if (prefcore)
+		WRITE_ONCE(cpudata->highest_perf, AMD_CPPC_HIGHEST_PERF(cap1));
+	else
+		WRITE_ONCE(cpudata->highest_perf, AMD_PSTATE_PREFCORE_THRESHOLD);

There is probably even more wrong, looking at the code quality, but this at least makes the preferred core work.

I don't know if we're discussing semantics. A performance score is attributed, and before the fix their scores were all 166. It doesn't work, as you said. So the consequence is the preferred core being "random", isn't it?

I don't know if it's random, the CPU scheduler still decides what thread to use. It will have its own semantics, but I don't know on what those are based.