{"id":100185,"date":"2018-11-12T07:00:00","date_gmt":"2018-11-12T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=100185"},"modified":"2019-12-21T08:33:08","modified_gmt":"2019-12-21T16:33:08","slug":"20181112-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20181112-00\/?p=100185","title":{"rendered":"The case of the System process that consumed a lot of CPU"},"content":{"rendered":"<p>A report came in through Feedback Hub that the System process was consuming high CPU. I was able to explain to the customer how to include a performance trace so the problem could be diagnosed.<\/p>\n<p>In case you want to file a performance issue, the way to include a performance trace is to go to the <i>Additional details<\/i> section and click the <i>Recreate my problem<\/i> button. You will get additional options:<\/p>\n<table style=\"width: 30pc; font-family: Segoe UI, sans-serif; font-size: 11pt;\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"background-color: #f2f2f2; color: black; padding: 10pt;\">\n<div>To help us understand what is causing the problem, please try to make it happen again while we follow along and capture data.<\/div>\n<div style=\"display: grid; grid: auto auto \/ auto 1fr; padding: 10pt 0pt; column-gap: 10px; row-gap: 10px;\">\n<div style=\"background-color: #2986cc; color: white; text-align: center; width: 15pt; height: 15pt;\">\u2713<\/div>\n<div>Include data about <span style=\"color: #2986cc;\">Performance<\/span> \u2335<\/div>\n<div style=\"background-color: #2986cc; color: white; text-align: center; width: 15pt; height: 15pt;\">\u2713<\/div>\n<div>Include screenshots of each step<\/div>\n<\/div>\n<div style=\"color: gray; font-size: 9pt;\">You will be able to review and edit the data before sending it.<\/div>\n<\/td>\n<td style=\"width: 10px;\">\u00a0<\/td>\n<td style=\"background-color: #2986cc; color: white; padding: 20pt; text-align: center;\">\n<div style=\"font-size: 40pt;\">\u23f1\ufe0e<\/div>\n<div>Start<br \/>\ncapture<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Check the <i>Include data about<\/i> box and select <i>Performance<\/i> as the category. Assuming the performance problem is ongoing, click <i>Start capture<\/i> and let it run for about 15 seconds, then click <i>Stop capture<\/i>. (If the performance problem occurs only when you perform a certain activity, then click <i>Start capture<\/i>, then do the activity that creates the performance issue, and then click <i>Stop capture<\/i>.)<\/p>\n<p>That creates a performance trace that will be attached to your report.<\/p>\n<p>Okay, let&#8217;s open the performance trace that this customer included. The tool for this is the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-hardware\/test\/wpt\/windows-performance-analyzer\"> Windows Performance Analyzer<\/a>.<\/p>\n<p>Since the problem is high CPU, the natural place to start is the Computation graph, which shows CPU usage.<\/p>\n<div style=\"height: 100px; width: 300px; position: relative; font-family: Segoe UI, sans-serif; font-size: 10pt; background-color: #e3a3a3; color: black;\" title=\"A CPU graph that shows no CPU usage for the first half of the trace, then suddenly jumps to 100% until the trace is almost over, whereupon it suddenly drops back down to 0%\">\n<div style=\"position: absolute; left: 5pt;\">Computation<\/div>\n<div style=\"padding-top: 1em\">(svg not supported on this site)<\/div>\n<\/div>\n<p>Yup, that sure looks like high CPU usage there.<\/p>\n<p>Create an analysis page for that graph and zoom in to the period of high CPU. Here&#8217;s what&#8217;s using the CPU:<\/p>\n<table style=\"border-collapse: collapse; font-size: 9pt; background-color: white; color: black; font-family: MS Sans Serif, sans-serif;\" title=\"System process using 65% of CPU, Idle 21%, others negligible\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr style=\"background-color: #f2f2f2;\">\n<td nowrap=\"nowrap\">Line #<\/td>\n<td style=\"width: 20ex;\" nowrap=\"nowrap\">Process<\/td>\n<td nowrap=\"nowrap\">Thread ID<\/td>\n<td style=\"width: 20em;\" nowrap=\"nowrap\">Stack<\/td>\n<td style=\"background-color: #ffd700; border-right: solid #dff0f8; width: 3px;\" rowspan=\"5\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">Count<\/td>\n<td nowrap=\"nowrap\">% Weight<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">1<\/td>\n<td nowrap=\"nowrap\">\u25b7 System<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,815<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.15<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">2<\/td>\n<td nowrap=\"nowrap\">Idle<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0<\/td>\n<td nowrap=\"nowrap\">\u25b7 [Idle]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">510<\/td>\n<td align=\"right\" nowrap=\"nowrap\">21.35<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">3<\/td>\n<td nowrap=\"nowrap\">\u25b7 Taskmgr.exe (14412)<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0.25<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">4<\/td>\n<td nowrap=\"nowrap\">\u25b7 MsMpEng.exe (5180)<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0.07<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>And indeed most of it is going to the System process with 65.15%. The Idle thread is a distant second with 21.35%, and everybody else is noise.<\/p>\n<p>So let&#8217;s dig into the System process.<\/p>\n<table style=\"border-collapse: collapse; font-size: 9pt; background-color: white; color: black; font-family: MS Sans Serif, sans-serif;\" title=\"All the threads in the System process are using roughly the same amount of CPU, between 1 and 3%.\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr style=\"background-color: #f2f2f2;\">\n<td nowrap=\"nowrap\">Line #<\/td>\n<td style=\"width: 20ex;\" nowrap=\"nowrap\">Process<\/td>\n<td nowrap=\"nowrap\">Thread ID<\/td>\n<td style=\"width: 20em;\" nowrap=\"nowrap\">Stack<\/td>\n<td style=\"background-color: #ffd700; border-right: solid #dff0f8; width: 3px;\" rowspan=\"24\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">Count<\/td>\n<td nowrap=\"nowrap\">% Weight<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">1<\/td>\n<td nowrap=\"nowrap\">\u25bcSystem (4)<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,815<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.15<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">2<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">9200<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,605<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.51<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">3<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">19708<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,576<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.44<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">4<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u25b718748<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,361<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.97<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">5<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">17480<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,346<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.93<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">6<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">12132<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,341<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.93<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">7<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">13020<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,220<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.67<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">8<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">15064<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,181<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.58<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">9<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">16364<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,084<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.36<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">10<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">11376<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,058<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.31<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">11<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">20444<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">994<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.17<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">12<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">21000<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">978<\/td>\n<td align=\"right\" nowrap=\"nowrap\">2.14<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">13<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">20648<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">905<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.97<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">14<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u25b719076<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">895<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.95<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">15<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">8572<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">757<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.65<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">16<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">13864<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">743<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.62<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">17<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">17072<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">685<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.50<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">18<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">16224<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">653<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.43<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">19<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u25b715988<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">625<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.37<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">20<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">19592<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">604<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.32<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">21<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1784<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">571<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.25<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">22<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">17872<\/td>\n<td nowrap=\"nowrap\">\u25b7[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">560<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1.22<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">\u22ee<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u22ee<\/td>\n<td nowrap=\"nowrap\">\u22ee<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u22ee<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u22ee<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hm, everything just flattens out. There&#8217;s no big culprit sucking up all the CPU.<\/p>\n<p>Are we being nibbled to death?<\/p>\n<p>Let&#8217;s look at two of those threads, maybe we&#8217;ll discover something.<\/p>\n<table style=\"border-collapse: collapse; font-size: 9pt; background-color: white; color: black; font-family: MS Sans Serif, sans-serif;\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr style=\"background-color: #f2f2f2;\">\n<td nowrap=\"nowrap\">Line #<\/td>\n<td style=\"width: 20ex;\" nowrap=\"nowrap\">Process<\/td>\n<td nowrap=\"nowrap\">Thread ID<\/td>\n<td style=\"width: 20em;\" nowrap=\"nowrap\">Stack<\/td>\n<td style=\"background-color: #ffd700; border-right: solid #dff0f8; width: 3px;\" rowspan=\"15\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">Count<\/td>\n<td nowrap=\"nowrap\">% Weight<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">1<\/td>\n<td nowrap=\"nowrap\">\u25bcSystem (4)<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,815<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.15<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">2<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">9200<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,605<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.51<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">3<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>ntoskrnl.exe!KxStartSystemThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,605<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.51<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">4<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!PspSystemThreadStartup<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,605<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.51<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">5<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!ExpWorkerThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,605<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.51<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">6<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25b7<\/span>|- ntoskrnl.exe!IopProcessWorkItem<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,554<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.40<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">7<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25b7<\/span>|- ntoskrnl.exe!KeRemovePriQueue<\/td>\n<td align=\"right\" nowrap=\"nowrap\">50<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0.11<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">8<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|- ntoskrnl.exe!ExpWorkerThread&lt;itself&gt;<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0.00<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">9<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">19708<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,576<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.44<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">10<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|- ntoskrnl.exe!KxStartSystemThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,574<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.44<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">11<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!PspSystemThreadStartup<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,574<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.44<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">12<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!ExpWorkerThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,574<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.44<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">13<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25b7<\/span>|\u00a0 \u00a0 |- ntoskrnl.exe!IopProcessWorkItem<\/td>\n<td align=\"right\" nowrap=\"nowrap\">1,538<\/td>\n<td align=\"right\" nowrap=\"nowrap\">3.36<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">14<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25b7<\/span>|\u00a0 \u00a0 |- ntoskrnl.exe!KeRemovePriQueue<\/td>\n<td align=\"right\" nowrap=\"nowrap\">36<\/td>\n<td align=\"right\" nowrap=\"nowrap\">0.08<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Okay, it seems that the threads are doing <code>Iop\u00adProcess\u00adWork\u00adItem<\/code>. That explains why the work is so evenly spread out: It&#8217;s a thread pool.<\/p>\n<p>Remove the <i>Thread ID<\/i> column because we don&#8217;t care about which thread is doing the work. Now we can group purely by stacks.<\/p>\n<table style=\"border-collapse: collapse; font-size: 9pt; background-color: white; color: black; font-family: MS Sans Serif, sans-serif;\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr style=\"background-color: #f2f2f2;\">\n<td nowrap=\"nowrap\">Line #<\/td>\n<td style=\"width: 20ex;\" nowrap=\"nowrap\">Process<\/td>\n<td style=\"width: 20em;\" nowrap=\"nowrap\">Stack<\/td>\n<td style=\"background-color: #ffd700; border-right: solid #dff0f8; width: 3px;\" rowspan=\"11\" nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">Count<\/td>\n<td nowrap=\"nowrap\">% Weight<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">1<\/td>\n<td nowrap=\"nowrap\">System (4)<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,815<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.14<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">2<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>[Root]<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,810<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.13<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">3<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|- ntoskrnl.exe!KxStartSystemThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,794<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.09<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">4<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!PspSystemThreadStartup<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,794<\/td>\n<td align=\"right\" nowrap=\"nowrap\">65.09<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">5<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\">|\u00a0 \u00a0 ntoskrnl.exe!ExpWorkerThread<\/td>\n<td align=\"right\" nowrap=\"nowrap\">29,699<\/td>\n<td align=\"right\" nowrap=\"nowrap\">64.89<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">6<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|\u00a0 \u00a0 |- ntoskrnl.exe!IopProcessWorkItem<\/td>\n<td align=\"right\" nowrap=\"nowrap\">28,742<\/td>\n<td align=\"right\" nowrap=\"nowrap\">62.81<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">7<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|\u00a0 \u00a0 |- contoso.sys!&lt;PDB not found&gt;<\/td>\n<td align=\"right\" nowrap=\"nowrap\">28,707<\/td>\n<td align=\"right\" nowrap=\"nowrap\">62.74<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">8<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|\u00a0 \u00a0 |\u00a0 \u00a0 |- contoso.sys!&lt;PDB not found&gt;<\/td>\n<td align=\"right\" nowrap=\"nowrap\">28,699<\/td>\n<td align=\"right\" nowrap=\"nowrap\">62.72<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">9<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25bc<\/span>|\u00a0 \u00a0 |\u00a0 \u00a0 |\u00a0 \u00a0 |- contoso.sys!&lt;PDB not found&gt;<\/td>\n<td align=\"right\" nowrap=\"nowrap\">28,588<\/td>\n<td align=\"right\" nowrap=\"nowrap\">62.48<\/td>\n<\/tr>\n<tr>\n<td align=\"right\" nowrap=\"nowrap\">10<\/td>\n<td nowrap=\"nowrap\">\u00a0<\/td>\n<td nowrap=\"nowrap\"><span style=\"width: 1em; display: inline-block;\">\u25b7<\/span>|\u00a0 \u00a0 |\u00a0 \u00a0 |\u00a0 \u00a0 |\u00a0 \u00a0 |- ntoskrnl.exe!RtlWriteRegistryValue<\/td>\n<td align=\"right\" nowrap=\"nowrap\">28,572<\/td>\n<td align=\"right\" nowrap=\"nowrap\">62.44<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Aha, basically all of the work items are going to the the Contoso driver, and that driver does very little work of its own. Of the 28,707 samples that showed that we were running a Contoso work item, 28,572 of them (over 99%) were in <code>Rtl\u00adWrite\u00adRegistry\u00adValue<\/code>.<\/p>\n<p>Basically, the Contoso driver was burning up all your CPU writing furiously to the registry.<\/p>\n<p>The developers at Contoso replied that the customer was running a version of the driver that was over a year old. They suggested the customer upgrade to the latest driver and see if that fixes the problem.<\/p>\n<p>I&#8217;m sure that upgrading to the latest driver will make the problem go away, but I&#8217;m not convinced that it&#8217;ll fix the problem. Because what&#8217;s probably happening is that the driver got into some sort of error state and is writing diagnostic information to the registry. That&#8217;ll go away even if you <i>don&#8217;t<\/i> upgrade the driver. All you have to do is reboot.<\/p>\n<p>The real question is what sort of error state the driver managed to get itself into.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s look at the performance trace.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-100185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Let&#8217;s look at the performance trace.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/100185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=100185"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/100185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=100185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=100185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=100185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}