NoXPhasma

joined 1 year ago
[–] [email protected] 1 points 1 year ago

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.

[–] [email protected] 9 points 1 year ago* (last edited 1 year ago) (2 children)

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.

[–] [email protected] 17 points 1 year ago (1 children)

AMD patches for preferred core (prefer those cores which can clock higher) are a mess and ended up not working because of a wrong if condition. Showing that no one at AMD even tested it before submitting. The programmer in the video complains about AMDs developers being incompetent and shows how it's fixed.