R7800 cache scaling issue

@facboy searching in the various mess of the L2 cache i found THIS

port to linux-4.19 and running normally

the link is broken but LUCKLY i found it

Will check it and compare them... As we are finally putting some work in kernel 4.19 to master i think we can finally implement this...


With original pr ported for 4.19 i got this result

root@No-Lag-Router:/tmp# ./mbw 32 | grep AVG
AVG     Method: MEMCPY  Elapsed: 0.07640        MiB: 32.00000   Copy: 418.856 MiB/s
AVG     Method: DUMB    Elapsed: 0.46355        MiB: 32.00000   Copy: 69.032 MiB/s
AVG     Method: MCBLOCK Elapsed: 0.08433        MiB: 32.00000   Copy: 379.459 MiB/s

Modified the patch with your changes and

here the report

root@No-Lag-Router:/tmp# ./mbw 32 | grep AVG
AVG     Method: MEMCPY  Elapsed: 0.05278        MiB: 32.00000   Copy: 606.316 MiB/s
AVG     Method: DUMB    Elapsed: 0.49566        MiB: 32.00000   Copy: 64.561 MiB/s
AVG     Method: MCBLOCK Elapsed: 0.05122        MiB: 32.00000   Copy: 624.724 MiB/s
root@No-Lag-Router:/tmp# ./mbw 32 | grep AVG
AVG     Method: MEMCPY  Elapsed: 0.06195        MiB: 32.00000   Copy: 516.577 MiB/s
AVG     Method: DUMB    Elapsed: 0.51844        MiB: 32.00000   Copy: 61.724 MiB/s
AVG     Method: MCBLOCK Elapsed: 0.05544        MiB: 32.00000   Copy: 577.208 MiB/s
root@No-Lag-Router:/tmp# ./mbw 32 | grep AVG
AVG     Method: MEMCPY  Elapsed: 0.06237        MiB: 32.00000   Copy: 513.046 MiB/s
AVG     Method: DUMB    Elapsed: 0.49267        MiB: 32.00000   Copy: 64.952 MiB/s
AVG     Method: MCBLOCK Elapsed: 0.04944        MiB: 32.00000   Copy: 647.219 MiB/s

Also can you tell me why the mutex lock ?
I added a check as i notice that it could happen that new_l2_volt is never updated (and cause problem with voltage regulator set)

	if (new_l2_volt > 0) {
		ret = regulator_set_voltage_tol(l2_regulator,new_l2_volt,tol);
		if (ret) {
			goto l2_reg_fail;
		}
	}