ExtendedTools: limit GPU usage to <=1

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4759 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2011-10-27 04:35:07 +00:00
parent bb08e789ce
commit fbb68a3051
+8
View File
@@ -409,6 +409,9 @@ static VOID NTAPI ProcessesUpdatedCallback(
EtGpuNodeUsage = (FLOAT)EtGpuTotalRunningTimeDelta.Delta / elapsedTime;
if (EtGpuNodeUsage > 1)
EtGpuNodeUsage = 1; // VMs seem to have very unreliable clocks
// Update per-process statistics.
// Note: no lock is needed because we only ever modify the list on this same thread.
@@ -424,8 +427,13 @@ static VOID NTAPI ProcessesUpdatedCallback(
EtpUpdateNodeInformation(block);
if (elapsedTime != 0)
{
block->GpuNodeUsage = (FLOAT)block->GpuRunningTimeDelta.Delta / elapsedTime;
if (block->GpuNodeUsage > 1)
block->GpuNodeUsage = 1;
}
if (maxNodeValue < block->GpuNodeUsage)
{
maxNodeValue = block->GpuNodeUsage;