Home
%3CLINGO-SUB%20id%3D%22lingo-sub-723630%22%20slang%3D%22en-US%22%3EThe%20Case%20of%20the%20System%20Process%20CPU%20Spikes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723630%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Apr%2007%2C%202008%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20As%20you%E2%80%99ve%20probably%20surmised%20by%20my%20blog%20posts%20and%20other%20writings%2C%20I%20like%20knowing%20exactly%20what%20my%20systems%20are%20doing.%20I%20want%20to%20know%20if%20a%20process%20is%20running%20away%20with%20the%20CPU%2C%20causing%20memory%20pressure%2C%20or%20hitting%20the%20disk.%20Besides%20keeping%20my%20computers%20running%20smoothly%2C%20my%20vigilance%20sometimes%20helps%20me%20spot%20performance%20and%20reliability%20problems%20in%20Windows%20and%20third-party%20code.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EThe%20main%20way%20I%20keep%20tabs%20on%20things%20is%20to%20configure%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb896653.aspx%22%20mce_href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb896653.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EProcess%20Explorer%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Eto%20run%20automatically%20when%20I%20log%20in.%20Whenever%20I%20configure%20a%20new%20computer%2C%20I%20add%20a%20shortcut%20to%20Process%20Explorer%20to%20my%20profile%E2%80%99s%20Start%20directory%20that%20includes%20the%20%2Ft%20(minimize)%20switch.%20Process%20Explorer%20runs%20otherwise%20hidden%20with%20tray%20icon%20that%20shows%20a%20small%20historical%20view%20of%20CPU%20activity%20level.%20Because%20I%20want%20access%20to%20detailed%20information%20about%20system%20processes%2C%20as%20well%20as%20my%20own%2C%20I%20also%20specify%20the%20%2Fe%20option%20on%20Vista%2C%20which%20causes%20Windows%20to%20present%20a%20UAC%20prompt%20on%20logon%20that%20allows%20me%20to%20grant%20Process%20Explorer%20administrative%20rights.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Because%20I%20keep%20an%20eye%20out%20for%20CPU%20spikes%20in%20Process%20Explorer%E2%80%99s%20tray%20icon%2C%20which%20show%20up%20as%20green%20or%20red%20for%20user-mode%20(application)%20and%20kernel-mode%20(operating%20system%20and%20drivers)%20CPU%20usage%2C%20respectively%2C%20I%E2%80%99ve%20identified%20several%20application%20bugs%20over%20the%20last%20few%20months.%20In%20this%20post%2C%20I%E2%80%99ll%20share%20how%20I%20used%20both%20Process%20Explorer%20and%20another%20tool%2C%20Kernrate%2C%20to%20identify%20a%20problem%20with%20a%20third-party%20driver%20and%20followed%20the%20problem%20through%20to%20a%20fix%20by%20the%20vendor.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Not%20long%20after%20I%20got%20a%20new%20laptop%20several%20months%20ago%2C%20I%20noticed%20that%20the%20system%20sometimes%20felt%20sluggish.%20Process%20Explorer%E2%80%99s%20tray%20icon%20corroborated%20my%20perception%20by%20displaying%20a%20mini-graph%20of%20red%20CPU%20activity.%20The%20icon%20opens%20a%20tooltip%20that%20reports%20the%20name%20of%20the%20process%20consuming%20the%20most%20CPU%20when%20you%20move%20the%20mouse%20over%20it%2C%20and%20in%20this%20case%20the%20tooltip%20showed%20the%20System%20process%20as%20being%20responsible%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%2268%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3030297%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3030297%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121015i6258BAB477430F2C%22%20style%3D%22WIDTH%3A%20125px%3B%20HEIGHT%3A%2068px%22%20width%3D%22125%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20size%3D%223%22%3E%20%3CFONT%20face%3D%22Calibri%22%3E%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20The%20first%20few%20times%20I%20noticed%20the%20problem%2C%20it%20resolved%20itself%20shortly%20after%20and%20I%20didn%E2%80%99t%20have%20a%20chance%20to%20troubleshoot.%20However%2C%20I%20could%20see%20by%20opening%20Process%20Explorer%E2%80%99s%20System%20Information%20dialog%20that%20the%20CPU%20spikes%20were%20significant%3A%20%3C%2FFONT%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22124%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029794%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029794%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121016iAAB314F6306A729E%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20124px%22%20width%3D%22550%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20The%20System%20process%20is%20special%20because%20it%20doesn%E2%80%99t%20host%20an%20executable%20image%20like%20other%20processes.%20It%20exists%20solely%20to%20host%20operating%20system%20threads%20for%20the%20memory%20manager%2C%20cache%20manager%2C%20and%20other%20subsystems%2C%20as%20well%20as%20device%20driver%20threads.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20These%20threads%20execute%20entirely%20in%20kernel%20mode%2C%20which%20is%20why%20System%20process%20CPU%20usage%20shows%20up%20as%20red%20in%20Process%20Explorer%E2%80%99s%20graphs.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20suspected%20that%20a%20third-party%20device%20driver%20was%20the%20cause%20of%20the%20problem%2C%20so%20the%20first%20step%20in%20my%20investigation%20was%20to%20figure%20out%20which%20thread%20was%20using%20CPU%2C%20which%20would%20hopefully%20point%20me%20at%20the%20guilty%20party.%20I%20watched%20vigilantly%20for%20signs%20of%20trouble%20every%20time%20I%20switched%20networks%20and%20jumped%20the%20first%20time%20I%20saw%20one.%20Process%20Explorer%20shows%20the%20threads%20running%20in%20a%20process%20on%20the%20Threads%20page%20of%20the%20Process%20Properties%20dialog%2C%20so%20I%20double-clicked%20on%20the%20System%20process%20and%20switched%20to%20the%20Threads%20page%20the%20next%20time%20I%20noticed%20the%20CPU%20spike%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029795%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029795%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121017iF288300BDE800D4D%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20The%20%E2%80%9Cntkrnlpa.exe%E2%80%9D%20prefix%20on%20each%20thread%E2%80%99s%20start%20address%20identified%20the%20ones%20I%20saw%20at%20the%20top%20of%20the%20CPU%20usage%20sort%20order%20as%20operating%20system%20threads%20(Ntkrnlpa.exe%20is%20the%20version%20of%20the%20kernel%20loaded%20on%2032-bit%20client%20systems%20that%20have%20no%20execute%20memory%20protection%20or%20server%20systems%20that%20need%20to%20address%20more%20than%204GB%20of%20memory).%20Because%20I%20had%20previously%20configured%20Process%20Explorer%20to%20retrieve%20symbols%20for%20operating%20system%20images%20from%20the%20Microsoft%20public%20symbol%20server%2C%20the%20thread%20list%20also%20showed%20the%20names%20of%20the%20thread%20start%20functions.%20The%20most%20active%20threads%20began%20in%20the%20ExpWorkerThread%20function%2C%20which%20means%20that%20they%20were%20worker%20threads%20that%20perform%20work%20on%20behalf%20of%20the%20system%20and%20device%20drivers.%20Instead%20of%20creating%20dedicated%20threads%20that%20consume%20memory%20resources%2C%20the%20system%20and%20drivers%20can%20throw%20work%20at%20the%20shared%20pool%20of%20operating%20system%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Faa490176.aspx%22%20mce_href%3D%22http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Faa490176.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eworker%20threads%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Unfortunately%2C%20knowing%20that%20worker%20threads%20were%20causing%20the%20CPU%20usage%20didn%E2%80%99t%20get%20me%20any%20closer%20to%20solving%20identifying%20a%20root%20cause.%20I%20really%20needed%20to%20know%20what%20functions%20the%20worker%20threads%20were%20calling%2C%20because%20the%20functions%20would%20be%20inside%20the%20device%20driver%20or%20operating%20system%20component%20on%20whose%20behalf%20the%20threads%20were%20running.%20One%20way%20to%20look%20inside%20a%20thread%E2%80%99s%20execution%20is%20to%20look%20at%20the%20thread%E2%80%99s%20stack%20with%20Process%20Explorer.%20The%20stack%20is%20a%20memory%20region%20that%20stores%20function%20invocations%20and%20Process%20Explorer%20will%20show%20you%20a%20thread%E2%80%99s%20stack%20when%20you%20select%20the%20thread%20press%20the%20Stack%20button%20or%20double-click%20on%20the%20thread.%20On%20Vista%2C%20however%2C%20you%20get%20this%20error%20when%20you%20try%20and%20look%20at%20the%20stack%20for%20threads%20in%20the%20System%20process%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22165%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029796%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029796%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121018iB47EA75F884E38EF%22%20style%3D%22WIDTH%3A%20229px%3B%20HEIGHT%3A%20165px%22%20width%3D%22229%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20The%20System%20process%20is%20a%20special%20type%20of%20process%20on%20Vista%20called%20a%20%E2%80%9Cprotected%20process%E2%80%9D%20that%20doesn%E2%80%99t%20allow%20any%20access%20to%20its%20threads%20or%20memory.%20Protected%20processes%20were%20introduced%20to%20support%20Digital%20Rights%20Management%20(DRM)%20so%20that%20hi-definition%20content%20providers%20can%20store%20content%20encryption%20keys%20with%20a%20reduced%20risk%20of%20an%20administrative%20user%20using%20DRM-stripping%20tools%20to%20reach%20into%20the%20process%20and%20read%20the%20keys.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20That%20approach%20foiled%2C%20I%20had%20to%20find%20another%20way%20to%20see%20what%20the%20worker%20threads%20were%20doing.%20For%20that%2C%20I%20turned%20to%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyID%3Dd6e95259-8d9d-4c22-89c4-fad382eddcd1%26amp%3BDisplayLang%3Den%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyID%3Dd6e95259-8d9d-4c22-89c4-fad382eddcd1%26amp%3BDisplayLang%3Den%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EKernRate%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%2C%20a%20command-line%20profiling%20tool%20that%E2%80%99s%20a%20free%20download%20from%20Microsoft.%20KernRate%20can%20profile%20user-mode%20processes%20and%20kernel-mode%20threads.%20It%20uses%20the%20sample-based%20profiling%20facility%20that%20was%20introduced%20in%20the%20first%20release%20of%20Windows%20NT%2C%20which%20records%20the%20unique%20addresses%20at%20which%20the%20CPU%20is%20executing%20when%20the%20profiling%20interval%20timer%20fires.%20When%20you%20stop%20a%20profile%20capture%2C%20Kernrate%20retrieves%20the%20information%20from%20the%20kernel%2C%20maps%20the%20addresses%20to%20the%20loaded%20device%20drivers%20into%20which%20the%20fall%2C%20and%20can%20even%20use%20the%20symbol%20engine%20to%20report%20the%20names%20of%20functions.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20wouldn%E2%80%99t%20need%20symbols%20if%20the%20trace%20identified%20a%20device%20driver%2C%20so%20I%20ran%20Kernrate%20without%20passing%20it%20any%20arguments.%20Despite%20the%20fact%20that%20there%E2%80%99s%20no%20officially%20supported%20version%20of%20Kernrate%20for%20Vista%2C%20the%20version%20for%20Windows%20XP%2C%20Kernrate_i386_XP.exe%2C%20works%20on%20Vista%2032-bit%20(you%20can%20also%20use%20the%20recently-released%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fwhdc%2Fsystem%2Fsysperf%2Fperftools.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fwhdc%2Fsystem%2Fsysperf%2Fperftools.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Experf%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Etool%20to%20perform%20similar%20profiling%20-%20xperf%20requires%20Vista%20or%20Server%202008%2C%20but%20works%20on%2064-bit%20versions).%20I%20let%20the%20profile%20run%20through%20heavy%20bursts%20of%20CPU%20and%20then%20hit%20Ctrl%2BC%20to%20print%20the%20results%20to%20the%20console%20window%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22150%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029797%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029797%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121019iF170B5A8B078248D%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20150px%22%20width%3D%22550%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20In%20first%20place%20were%20hits%20in%20the%20kernel%2C%20but%20in%20second%20was%20a%20driver%20that%20I%20didn%E2%80%99t%20recognize%2C%20b57nd60x.%20Most%20driver%20files%20are%20located%20in%20the%20%25systemroot%25%5Csystem32%5Cdrivers%20directory%2C%20so%20I%20could%20have%20opened%20that%20folder%20and%20viewed%20the%20file%E2%80%99s%20properties%20in%20Explorer%2C%20but%20I%20had%20Process%20Explorer%20open%20so%20a%20quicker%20way%20to%20check%20the%20driver%E2%80%99s%20vendor%20and%20version%20was%20to%20open%20the%20DLL%20view%20for%20the%20System%20process.%20The%20DLL%20view%20shows%20the%20DLLs%20and%20files%20mapped%20into%20the%20address%20space%20of%20user-mode%20processes%2C%20but%20for%20the%20System%20process%20it%20shows%20the%20kernel%20modules%2C%20including%20drivers%2C%20loaded%20on%20the%20system.%20The%20DLL%20view%20revealed%20that%20the%20driver%20was%20for%20my%20laptop%E2%80%99s%20NIC%2C%20was%20from%20Broadcom%2C%20and%20was%20version%2010.10%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22320%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029798%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F3029798%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121020iC5675BDE40520B6B%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20320px%22%20width%3D%22550%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Now%20that%20I%20knew%20that%20the%20Broadcom%20driver%20was%20causing%20the%20CPU%20usage%2C%20the%20next%20step%20was%20to%20see%20if%20there%20was%20a%20newer%20version%20available.%20I%20went%20to%20Dell%E2%80%99s%20download%20page%20for%20my%20system%2C%20but%20didn%E2%80%99t%20find%20anything.%20Suspecting%20that%20what%20I%20noticed%20might%20not%20be%20a%20known%20issue%2C%20I%20decided%20to%20notify%20Broadcom.%20I%20used%20contacts%20on%20the%20hardware%20ecosystem%20team%20here%20at%20Microsoft%20to%20find%20the%20Broadcom%20driver%20representative%20and%20email%20him%20a%20detailed%20description%20of%20the%20symptoms%20and%20my%20investigation.%20He%20forwarded%20my%20email%20to%20the%20driver%20developer%2C%20who%20acknowledged%20that%20they%20didn%E2%80%99t%20know%20the%20cause%20and%20within%20a%20few%20days%20sent%20me%20a%20debug%20version%20of%20the%20driver%20with%20symbols%20so%20that%20I%20could%20capture%20a%20Kernrate%20profile%20that%20would%20tell%20them%20what%20functions%20in%20the%20driver%20were%20active%20during%20the%20spikes.%20The%20problem%20reoccurred%20a%20few%20days%20later%20and%20I%20sent%20back%20the%20kernrate%20output%20with%20function%20information.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20The%20developer%20explained%20that%20my%20trace%20revealed%20that%20the%20driver%20didn%E2%80%99t%20efficiently%20interact%20with%20the%20PCIe%20bus%20when%20processing%20specific%20queries%20and%20the%20problem%20seemed%20to%20be%20exacerbated%20by%20my%20particular%20hardware%20configuration.%20He%20gave%20me%20new%20driver%20for%20me%20to%20try%20and%20after%20a%20few%20weeks%20of%20monitoring%20my%20laptop%20closely%20for%20issues%2C%20I%20confirmed%20that%20the%20problem%20appeared%20to%20be%20resolved.%20The%20updated%20driver%20has%20not%20yet%20been%20posted%20to%20Dell%E2%80%99s%20support%20site%2C%20but%20I%20expect%20it%20to%20show%20up%20there%20in%20the%20near%20future.%20Another%20case%20closed%2C%20this%20time%20with%20Process%20Explorer%2C%20Kernrate%2C%20and%20a%20helpful%20Broadcom%20driver%20developer.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EIf%20you%20like%20these%20troubleshooting%20blog%20posts%2C%20you%E2%80%99ll%20enjoy%20the%20webcast%20of%20my%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Femea%2Fspotlight%2Fsessionh.aspx%3Fvideoid%3D722%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Femea%2Fspotlight%2Fsessionh.aspx%3Fvideoid%3D722%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%E2%80%9CCase%20of%20the%20Unexplained%E2%80%A6%E2%80%9D%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Esession%20from%20TechEd%2FITforum.%20Its%2075%20minutes%20are%20packed%20with%20real-world%20troubleshooting%20examples%2C%20including%20the%20one%20written%20up%20in%20this%20post%20and%20others%2C%20as%20well%20as%20some%20that%20I%20haven%E2%80%99t%20documented.%20At%20the%20end%20of%20the%20session%20I%20ask%20the%20audience%20to%20send%20me%20screenshots%2C%20log%20files%20and%20descriptions%20of%20their%20own%20troubleshooting%20success%20stories%2C%20in%20return%20for%20which%20I%E2%80%99ll%20send%20back%20a%20signed%20copy%20of%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb963901.aspx%22%20mce_href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Fsysinternals%2Fbb963901.aspx%20%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20Internals%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E.%20The%20offer%20stands%2C%20so%20remember%20to%20document%20your%20investigation%20and%20you%20can%20get%20a%20free%20book.%20I%E2%80%99ve%20gotten%20a%20number%20of%20great%20examples%20and%20my%20next%20blog%20post%20will%20be%20a%20guest%20post%20by%20someone%20that%20watched%20the%20webcast%20and%20used%20Process%20Monitor%20to%20solve%20a%20problem%20with%20their%20web%20server.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EFinally%2C%20if%20you%20want%20to%20see%20me%20speak%20live%2C%20come%20to%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fevents%2Fteched2008%2Fitpro%2Fdefault.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fevents%2Fteched2008%2Fitpro%2Fdefault.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETechEd%20US%2FIT%20Pro%20%3C%2FA%3E%3C%2FFONT%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Ein%20June%20in%20Orlando%20where%20I%E2%80%99ll%20be%20delivering%20%E2%80%9CThe%20Case%20of%20the%20Unexplained%E2%80%A6%E2%80%9D%2C%20%E2%80%9CWindows%20Server%202008%20Kernel%20Advances%E2%80%9D%2C%20and%20%E2%80%9CWindows%20Security%20Boundaries%E2%80%9D.%20Hope%20to%20see%20you%20there!%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-723630%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Apr%2007%2C%202008%20As%20you%E2%80%99ve%20probably%20surmised%20by%20my%20blog%20posts%20and%20other%20writings%2C%20I%20like%20knowing%20exactly%20what%20my%20systems%20are%20doing.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723630%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMark%20Russinovich%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on TechNet on Apr 07, 2008

As you’ve probably surmised by my blog posts and other writings, I like knowing exactly what my systems are doing. I want to know if a process is running away with the CPU, causing memory pressure, or hitting the disk. Besides keeping my computers running smoothly, my vigilance sometimes helps me spot performance and reliability problems in Windows and third-party code.


The main way I keep tabs on things is to configure Process Explorer to run automatically when I log in. Whenever I configure a new computer, I add a shortcut to Process Explorer to my profile’s Start directory that includes the /t (minimize) switch. Process Explorer runs otherwise hidden with tray icon that shows a small historical view of CPU activity level. Because I want access to detailed information about system processes, as well as my own, I also specify the /e option on Vista, which causes Windows to present a UAC prompt on logon that allows me to grant Process Explorer administrative rights.


Because I keep an eye out for CPU spikes in Process Explorer’s tray icon, which show up as green or red for user-mode (application) and kernel-mode (operating system and drivers) CPU usage, respectively, I’ve identified several application bugs over the last few months. In this post, I’ll share how I used both Process Explorer and another tool, Kernrate, to identify a problem with a third-party driver and followed the problem through to a fix by the vendor.


Not long after I got a new laptop several months ago, I noticed that the system sometimes felt sluggish. Process Explorer’s tray icon corroborated my perception by displaying a mini-graph of red CPU activity. The icon opens a tooltip that reports the name of the process consuming the most CPU when you move the mouse over it, and in this case the tooltip showed the System process as being responsible:



The first few times I noticed the problem, it resolved itself shortly after and I didn’t have a chance to troubleshoot. However, I could see by opening Process Explorer’s System Information dialog that the CPU spikes were significant:




The System process is special because it doesn’t host an executable image like other processes. It exists solely to host operating system threads for the memory manager, cache manager, and other subsystems, as well as device driver threads. These threads execute entirely in kernel mode, which is why System process CPU usage shows up as red in Process Explorer’s graphs.


I suspected that a third-party device driver was the cause of the problem, so the first step in my investigation was to figure out which thread was using CPU, which would hopefully point me at the guilty party. I watched vigilantly for signs of trouble every time I switched networks and jumped the first time I saw one. Process Explorer shows the threads running in a process on the Threads page of the Process Properties dialog, so I double-clicked on the System process and switched to the Threads page the next time I noticed the CPU spike:




The “ntkrnlpa.exe” prefix on each thread’s start address identified the ones I saw at the top of the CPU usage sort order as operating system threads (Ntkrnlpa.exe is the version of the kernel loaded on 32-bit client systems that have no execute memory protection or server systems that need to address more than 4GB of memory). Because I had previously configured Process Explorer to retrieve symbols for operating system images from the Microsoft public symbol server, the thread list also showed the names of the thread start functions. The most active threads began in the ExpWorkerThread function, which means that they were worker threads that perform work on behalf of the system and device drivers. Instead of creating dedicated threads that consume memory resources, the system and drivers can throw work at the shared pool of operating system worker threads .


Unfortunately, knowing that worker threads were causing the CPU usage didn’t get me any closer to solving identifying a root cause. I really needed to know what functions the worker threads were calling, because the functions would be inside the device driver or operating system component on whose behalf the threads were running. One way to look inside a thread’s execution is to look at the thread’s stack with Process Explorer. The stack is a memory region that stores function invocations and Process Explorer will show you a thread’s stack when you select the thread press the Stack button or double-click on the thread. On Vista, however, you get this error when you try and look at the stack for threads in the System process:




The System process is a special type of process on Vista called a “protected process” that doesn’t allow any access to its threads or memory. Protected processes were introduced to support Digital Rights Management (DRM) so that hi-definition content providers can store content encryption keys with a reduced risk of an administrative user using DRM-stripping tools to reach into the process and read the keys.


That approach foiled, I had to find another way to see what the worker threads were doing. For that, I turned to KernRate , a command-line profiling tool that’s a free download from Microsoft. KernRate can profile user-mode processes and kernel-mode threads. It uses the sample-based profiling facility that was introduced in the first release of Windows NT, which records the unique addresses at which the CPU is executing when the profiling interval timer fires. When you stop a profile capture, Kernrate retrieves the information from the kernel, maps the addresses to the loaded device drivers into which the fall, and can even use the symbol engine to report the names of functions.


I wouldn’t need symbols if the trace identified a device driver, so I ran Kernrate without passing it any arguments. Despite the fact that there’s no officially supported version of Kernrate for Vista, the version for Windows XP, Kernrate_i386_XP.exe, works on Vista 32-bit (you can also use the recently-released xperf tool to perform similar profiling - xperf requires Vista or Server 2008, but works on 64-bit versions). I let the profile run through heavy bursts of CPU and then hit Ctrl+C to print the results to the console window:




In first place were hits in the kernel, but in second was a driver that I didn’t recognize, b57nd60x. Most driver files are located in the %systemroot%\system32\drivers directory, so I could have opened that folder and viewed the file’s properties in Explorer, but I had Process Explorer open so a quicker way to check the driver’s vendor and version was to open the DLL view for the System process. The DLL view shows the DLLs and files mapped into the address space of user-mode processes, but for the System process it shows the kernel modules, including drivers, loaded on the system. The DLL view revealed that the driver was for my laptop’s NIC, was from Broadcom, and was version 10.10:




Now that I knew that the Broadcom driver was causing the CPU usage, the next step was to see if there was a newer version available. I went to Dell’s download page for my system, but didn’t find anything. Suspecting that what I noticed might not be a known issue, I decided to notify Broadcom. I used contacts on the hardware ecosystem team here at Microsoft to find the Broadcom driver representative and email him a detailed description of the symptoms and my investigation. He forwarded my email to the driver developer, who acknowledged that they didn’t know the cause and within a few days sent me a debug version of the driver with symbols so that I could capture a Kernrate profile that would tell them what functions in the driver were active during the spikes. The problem reoccurred a few days later and I sent back the kernrate output with function information.


The developer explained that my trace revealed that the driver didn’t efficiently interact with the PCIe bus when processing specific queries and the problem seemed to be exacerbated by my particular hardware configuration. He gave me new driver for me to try and after a few weeks of monitoring my laptop closely for issues, I confirmed that the problem appeared to be resolved. The updated driver has not yet been posted to Dell’s support site, but I expect it to show up there in the near future. Another case closed, this time with Process Explorer, Kernrate, and a helpful Broadcom driver developer.


If you like these troubleshooting blog posts, you’ll enjoy the webcast of my “Case of the Unexplained…” session from TechEd/ITforum. Its 75 minutes are packed with real-world troubleshooting examples, including the one written up in this post and others, as well as some that I haven’t documented. At the end of the session I ask the audience to send me screenshots, log files and descriptions of their own troubleshooting success stories, in return for which I’ll send back a signed copy of Windows Internals . The offer stands, so remember to document your investigation and you can get a free book. I’ve gotten a number of great examples and my next blog post will be a guest post by someone that watched the webcast and used Process Monitor to solve a problem with their web server.


Finally, if you want to see me speak live, come to TechEd US/IT Pro in June in Orlando where I’ll be delivering “The Case of the Unexplained…”, “Windows Server 2008 Kernel Advances”, and “Windows Security Boundaries”. Hope to see you there!