No meu gráfico CPU, notei recentemente que, quando compilo coisas, nunca consigo chegar a 100% de uso, ele continua subindo e descendo em torno de 60-70% no máximo.
Exemplo:
Poroutrolado,estegráficoécompletamenteopacoquandofeitonomeucomputadordetrabalho.
Euquerochegaraofundodissoeestouusandooutilitário stress para simular o uso da CPU e vmstat para observar. Estou correndo estresse com contagem de núcleos de CPU variando de 1 a 15 (minha CPU tem 12 núcleos lógicos). Aqui está o resultado, com a linha 1 correspondente a 1 núcleo executando 100%, a linha 2 é 2 núcleos, etc:
procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 24455180 465548 2862716 0 0 0 38 944 3184 11 1 88 0 0
3 0 0 24508640 465552 2862684 0 0 0 196 1112 2841 18 1 81 0 0
3 0 0 24556876 465564 2865096 0 0 0 63 1880 4569 30 1 70 0 0
4 0 0 24624764 465576 2865044 0 0 0 11 1414 1005 34 0 66 0 0
5 0 0 24625228 465580 2865068 0 0 0 9 1603 1029 42 0 58 0 0
6 0 0 24763772 465600 2864912 0 0 1 159 1973 1032 51 0 49 0 0
8 0 0 24786696 465600 2864844 0 0 0 9 2460 751 56 0 44 0 0
8 0 0 24805572 465600 2864864 0 0 0 78 2619 808 61 0 38 0 0
10 0 0 24811064 465604 2864852 0 0 0 50 2532 761 56 0 44 0 0
14 0 0 24809904 465616 2865180 0 0 0 4 2823 1049 63 0 37 0 0
13 0 0 24868936 465620 2865116 0 0 0 76 2596 709 57 0 43 0 0
19 0 0 24910408 465628 2866136 0 0 0 12 2526 738 56 0 44 0 0
16 0 0 24914768 465636 2865244 0 0 0 36 2757 720 62 0 38 0 0
18 0 0 24914332 465644 2865256 0 0 0 3 2629 862 59 0 41 0 0
19 0 0 24945952 465648 2866224 0 0 0 33 2642 678 59 0 41 0 0
O script que eu executei:
for corecount in $(seq 15); do
stress -c $corecount >/dev/null&
sleep 1
vmstat -w 4 2 | tail -1
pkill stress
sleep 1
done
Ao olhar para a coluna us
, vejo que o uso da cpu aumenta linearmente, conforme esperado, para 6-8 núcleos lógicos, mas depois disso, está atingindo algum outro gargalo. O cursor do mouse começa a ficar atrasado neste ponto, e se eu tentar executar enquanto um jogador videp estiver em execução, ele também começará a gaguejar neste momento. (para comparação, aqui está o mesmo teste exato quando feito no meu computador de trabalho: link . Aqui o uso da cpu simplesmente sobe linearmente até 99 / 100 e fica lá (a saturação está na linha 8 porque é uma cpu de 8 núcleos))
(aqui está o gráfico da cpu para todo o teste, com o ponto de estrangulamento visível: )
Informaçõesgerais:
Ubuntu16.04LTS,memóriade32gb,CPUi7-5820Kde6núcleos.
free-h
totalusedfreesharedbuff/cacheavailableMem:31G4,8G23G90M3,3G26GSwap:15G0B15G
/proc/cpuinfo
processor:0vendor_id:GenuineIntelcpufamily:6model:63modelname:Intel(R)Core(TM)[email protected]:2microcode:0x2dcpuMHz:1236.339cachesize:15360KBphysicalid:0siblings:12coreid:0cpucores:6apicid:0initialapicid:0fpu:yesfpu_exception:yescpuidlevel:15wp:yesflags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsacpimmxfxsrssesse2sshttmpbesyscallnxpdpe1gbrdtscplmconstant_tscarch_perfmonpebsbtsrep_goodnoplxtopologynonstop_tscaperfmperfeagerfpupnipclmulqdqdtes64monitords_cplvmxesttm2ssse3fmacx16xtprpdcmpciddcasse4_1sse4_2x2apicmovbepopcnttsc_deadline_timeraesxsaveavxf16crdrandlahf_lmabmidaaratplnptsdthermtpr_shadowvnmiflexpriorityeptvpidfsgsbasetsc_adjustbmi1avx2smepbmi2ermsinvpcidcqmxsaveoptcqm_llccqm_occup_llcbugs:bogomips:6599.39clflushsize:64cache_alignment:64addresssizes:46bitsphysical,48bitsvirtualpowermanagement:[...]processor:11vendor_id:GenuineIntelcpufamily:6model:63modelname:Intel(R)Core(TM)[email protected]:2microcode:0x2dcpuMHz:1200.246cachesize:15360KBphysicalid:0siblings:12coreid:5cpucores:6apicid:11initialapicid:11fpu:yesfpu_exception:yescpuidlevel:15wp:yesflags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsacpimmxfxsrssesse2sshttmpbesyscallnxpdpe1gbrdtscplmconstant_tscarch_perfmonpebsbtsrep_goodnoplxtopologynonstop_tscaperfmperfeagerfpupnipclmulqdqdtes64monitords_cplvmxesttm2ssse3fmacx16xtprpdcmpciddcasse4_1sse4_2x2apicmovbepopcnttsc_deadline_timeraesxsaveavxf16crdrandlahf_lmabmidaaratplnptsdthermtpr_shadowvnmiflexpriorityeptvpidfsgsbasetsc_adjustbmi1avx2smepbmi2ermsinvpcidcqmxsaveoptcqm_llccqm_occup_llcbugs:bogomips:6599.39clflushsize:64cache_alignment:64addresssizes:46bitsphysical,48bitsvirtualpowermanagement:
lspci
00:00.0Hostbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7DMI2(rev02)00:01.0PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort1(rev02)00:01.1PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort1(rev02)00:02.0PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort2(rev02)00:02.2PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort2(rev02)00:02.3PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort2(rev02)00:03.0PCIbridge:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIExpressRootPort3(rev02)00:05.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7AddressMap,VTd_Misc,SystemManagement(rev02)00:05.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7HotPlug(rev02)00:05.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7RAS,ControlStatusandGlobalErrors(rev02)00:05.4PIC:IntelCorporationXeonE7v3/XeonE5v3/Corei7I/OAPIC(rev02)00:11.0Unassignedclass[ff00]:IntelCorporationC610/X99serieschipsetSPSR(rev05)00:14.0USBcontroller:IntelCorporationC610/X99serieschipsetUSBxHCIHostController(rev05)00:16.0Communicationcontroller:IntelCorporationC610/X99serieschipsetMEIController#1(rev05)00:19.0Ethernetcontroller:IntelCorporationEthernetConnection(2)I218-V(rev05)00:1a.0USBcontroller:IntelCorporationC610/X99serieschipsetUSBEnhancedHostController#2(rev05)00:1b.0Audiodevice:IntelCorporationC610/X99serieschipsetHDAudioController(rev05)00:1c.0PCIbridge:IntelCorporationC610/X99serieschipsetPCIExpressRootPort#1(revd5)00:1c.4PCIbridge:IntelCorporationC610/X99serieschipsetPCIExpressRootPort#5(revd5)00:1d.0USBcontroller:IntelCorporationC610/X99serieschipsetUSBEnhancedHostController#1(rev05)00:1f.0ISAbridge:IntelCorporationC610/X99serieschipsetLPCController(rev05)00:1f.2SATAcontroller:IntelCorporationC610/X99serieschipset6-PortSATAController[AHCImode](rev05)00:1f.3SMBus:IntelCorporationC610/X99serieschipsetSMBusController(rev05)06:00.0VGAcompatiblecontroller:NVIDIACorporationGF104[GeForceGTX460](reva1)06:00.1Audiodevice:NVIDIACorporationGF104HighDefinitionAudioController(reva1)08:00.0USBcontroller:ASMediaTechnologyInc.ASM1142USB3.1HostControllerff:0b.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7R3QPILink0&1Monitoring(rev02)ff:0b.1Performancecounters:IntelCorporationXeonE7v3/XeonE5v3/Corei7R3QPILink0&1Monitoring(rev02)ff:0b.2Performancecounters:IntelCorporationXeonE7v3/XeonE5v3/Corei7R3QPILink0&1Monitoring(rev02)ff:0c.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0c.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0c.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0c.3Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0c.4Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0c.5Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7UnicastRegisters(rev02)ff:0f.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7BufferedRingAgent(rev02)ff:0f.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7BufferedRingAgent(rev02)ff:0f.4Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7SystemAddressDecoder&BroadcastRegisters(rev02)ff:0f.5Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7SystemAddressDecoder&BroadcastRegisters(rev02)ff:0f.6Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7SystemAddressDecoder&BroadcastRegisters(rev02)ff:10.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIeRingInterface(rev02)ff:10.1Performancecounters:IntelCorporationXeonE7v3/XeonE5v3/Corei7PCIeRingInterface(rev02)ff:10.5Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7Scratchpad&SemaphoreRegisters(rev02)ff:10.6Performancecounters:IntelCorporationXeonE7v3/XeonE5v3/Corei7Scratchpad&SemaphoreRegisters(rev02)ff:10.7Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7Scratchpad&SemaphoreRegisters(rev02)ff:12.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7HomeAgent0(rev02)ff:12.1Performancecounters:IntelCorporationXeonE7v3/XeonE5v3/Corei7HomeAgent0(rev02)ff:13.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0TargetAddress,Thermal&RASRegisters(rev02)ff:13.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0TargetAddress,Thermal&RASRegisters(rev02)ff:13.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0ChannelTargetAddressDecoder(rev02)ff:13.3Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0ChannelTargetAddressDecoder(rev02)ff:13.4Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0ChannelTargetAddressDecoder(rev02)ff:13.5Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0ChannelTargetAddressDecoder(rev02)ff:13.6Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIOChannel0/1Broadcast(rev02)ff:13.7Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIOGlobalBroadcast(rev02)ff:14.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel0ThermalControl(rev02)ff:14.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel1ThermalControl(rev02)ff:14.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel0ERRORRegisters(rev02)ff:14.3Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel1ERRORRegisters(rev02)ff:14.6Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)0&1(rev02)ff:14.7Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)0&1(rev02)ff:15.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel2ThermalControl(rev02)ff:15.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel3ThermalControl(rev02)ff:15.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel2ERRORRegisters(rev02)ff:15.3Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController0Channel3ERRORRegisters(rev02)ff:16.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController1TargetAddress,Thermal&RASRegisters(rev02)ff:16.6Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIOChannel2/3Broadcast(rev02)ff:16.7Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIOGlobalBroadcast(rev02)ff:17.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7IntegratedMemoryController1Channel0ThermalControl(rev02)ff:17.4Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)2&3(rev02)ff:17.5Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)2&3(rev02)ff:17.6Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)2&3(rev02)ff:17.7Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7DDRIO(VMSE)2&3(rev02)ff:1e.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PowerControlUnit(rev02)ff:1e.1Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PowerControlUnit(rev02)ff:1e.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PowerControlUnit(rev02)ff:1e.3Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PowerControlUnit(rev02)ff:1e.4Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7PowerControlUnit(rev02)ff:1f.0Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7VCU(rev02)ff:1f.2Systemperipheral:IntelCorporationXeonE7v3/XeonE5v3/Corei7VCU(rev02)
/proc/meminfo
MemTotal:32841924kBMemFree:24244428kBMemAvailable:27418672kBBuffers:478012kBCached:2622028kBSwapCached:0kBActive:6606180kBInactive:1240728kBActive(anon):4758584kBInactive(anon):85340kBActive(file):1847596kBInactive(file):1155388kBUnevictable:8020kBMlocked:8020kBSwapTotal:16669692kBSwapFree:16669692kBDirty:284kBWriteback:0kBAnonPages:4754864kBMapped:780304kBShmem:93528kBSlab:346300kBSReclaimable:257036kBSUnreclaim:89264kBKernelStack:22112kBPageTables:109808kBNFS_Unstable:0kBBounce:0kBWritebackTmp:0kBCommitLimit:33090652kBCommitted_AS:16302224kBVmallocTotal:34359738367kBVmallocUsed:371016kBVmallocChunk:34358945788kBHardwareCorrupted:0kBAnonHugePages:761856kBCmaTotal:0kBCmaFree:0kBHugePages_Total:0HugePages_Free:0HugePages_Rsvd:0HugePages_Surp:0Hugepagesize:2048kBDirectMap4k:537784kBDirectMap2M:5648384kBDirectMap1G:29360128kB
umacapturadeteladeusodacpumaisdetalhadadoksysguardenquantotestaotestecom10núcleos:
O que está acontecendo? Que outras partes do kernel eu posso observar para ver o que está acontecendo? Existe alguma configuração de agendador de cpu que tem sido? Nem sempre foi assim, estou absolutamente certo de que tenho sido capaz de compilar antes com 100% de utilização de cpu sem atraso de mouse e realmente não percebendo isso, exceto para os fãs rodando.