-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
telemetry: Add mutex to avoid push during recalc and other races #1845
Conversation
Bisecting but this patch might hang Windows+CUDA exiting after benchmark. That or Windows+CUDA no longer exits after benchmark mode? It does in OpenCL or just CPU modes. As far as I understand the mutex should destruct just fine in any state, so I'm not sure why this would hang the main executor loop. But also there seems to be some locking inside executor so this may be superfluous. I was previously unsure if reporting events were locked vs the incoming pushes in all cases. Also stats are accurate (match pool shown rate exactly), running this on every one of my current XMR miners (all CPUs). I do believe they are more stable and accurate. |
Does this means this PR can currently not used together with CUDA? IF so we need to fix that first. |
Confirmed my build does not exit even without this patch, so it is GOOD. Reasonably sure there are several missing |
15f4b73
to
f03319c
Compare
example of rock solid hashrates from a rig running for the last day or so:
This same rig without this mutex always had variances everywhere (+-0.7 per thread)
non-AES cpu |
With fireice-uk#1845 a race condition during the telemetry update is solved. The problem is that the used mutex is blocking all threads from updating the metrics during the statistics are calculated. - introduce a mutex per miner thread
With fireice-uk#1845 a race condition during the telemetry update is solved. The problem is that the used mutex is blocking all threads from updating the metrics during the statistics are calculated. - introduce a mutex per miner thread
Add simple locking to telemetry class, since both push and calc methods modify the data buckets and pointers, this avoids race conditions and bucket corruption.
Hoping this solves occasional "missing stats" or inaccuracy that could not be tracked down to anything but "thread timing mystery". It does seem to standardize my hashrates as shown which I take to mean it's more accurate.
Regardless it doesn't seem to hurt.