Читаем Windows® Internals, Sixth Edition, Part 2 полностью

You can also see the complete PPM information for a given processor by looking at the PRCB’s PowerState field and further drilling down into the Domain and PerfConstraint members. This will show you the selected domain performance state, the constraints (thermal and frequency caps), and other accounting information. You can use dt nt!_KPRCB @$prcb PowerState to see this information for the current PRCB: +0x33a0 PowerState : +0x000 IdleStates : 0x877fe1b0 _PPM_IDLE_STATES +0x008 IdleTimeLast : 0xa6 +0x010 IdleTimeTotal : 0x97789fc9 +0x018 IdleTimeEntry : 0 +0x020 IdleAccounting : 0x874d8008 _PROC_IDLE_ACCOUNTING +0x024 Hypervisor : 0 ( ProcHypervisorNone ) +0x028 PerfHistoryTotal : 0 +0x02c ThermalConstraint : 0x64 'd' +0x02d PerfHistoryCount : 0x1 '' +0x02e PerfHistorySlot : 0 '' +0x02f Reserved : 0 '' +0x030 LastSysTime : 0xfa86 +0x034 WmiDispatchPtr : 0x837c5464 +0x038 WmiInterfaceEnabled : 0n1 +0x040 FFHThrottleStateInfo : _PPM_FFH_THROTTLE_STATE_INFO +0x060 PerfActionDpc : _KDPC +0x080 PerfActionMask : 0n0 +0x088 IdleCheck : _PROC_IDLE_SNAP +0x098 PerfCheck : _PROC_IDLE_SNAP +0x0a8 Domain : 0x874d9c50 _PROC_PERF_DOMAIN +0x0ac PerfConstraint : 0x874d9cc8 _PROC_PERF_CONSTRAINT +0x0b0 Load : (null) +0x0b4 PerfHistory : (null) +0x0b8 Utility : 0xba8 +0x0bc OverUtilizedHistory : 0 +0x0c0 AffinityCount : 0 +0x0c4 AffinityHistory : 0 lkd> dt 0x874d9c50 _PROC_PERF_DOMAIN nt!_PROC_PERF_DOMAIN +0x000 Link : _LIST_ENTRY [ 0x8376b39c - 0x8376b39c ] +0x008 Master : 0x8b470120 _KPRCB +0x00c Members : _KAFFINITY_EX +0x018 FeedbackHandler : 0x93d19d08 unsigned char +0 +0x01c GetFFHThrottleState : 0x93d1804e void +0 +0x020 BoostPolicyHandler : 0x93d18104 void +0 +0x024 PerfSelectionHandler : 0x93d19bee unsigned long +0 +0x028 PerfHandler : 0x93d19d40 void +0 +0x02c Processors : 0x874d9cc8 _PROC_PERF_CONSTRAINT +0x030 PerfChangeTime : 0xaa90c1ed +0x038 ProcessorCount : 4 +0x03c PreviousFrequencyMhz : 0x532 +0x040 CurrentFrequencyMhz : 0xa65 +0x044 PreviousFrequency : 0x31 +0x048 CurrentFrequency : 0x64 +0x04c CurrentPerfContext : 0 +0x050 DesiredFrequency : 0x64 +0x054 MaxFrequency : 0xa65 +0x058 MinPerfPercent : 0x2c +0x05c MinThrottlePercent : 5 +0x060 MaxPercent : 0x64 +0x064 MinPercent : 5 +0x068 ConstrainedMaxPercent : 0x64 +0x06c ConstrainedMinPercent : 0x2c +0x070 Coordination : 0x1 '' +0x074 PerfChangeIntervalCount : 0n0 lkd> dt 0x874d9cc8 _PROC_PERF_CONSTRAINT ntdll!_PROC_PERF_CONSTRAINT +0x000 Prcb : 0x8376cd20 _KPRCB +0x004 PerfContext : 0x877febe0 +0x008 PercentageCap : 0x64 +0x00c ThermalCap : 0x64 +0x010 TargetFrequency : 0x36 +0x014 AcumulatedFullFrequency : 0x46c3df +0x018 AcumulatedZeroFrequency : 0xd51828 +0x01c FrequencyHistoryTotal : 0 +0x020 AverageFrequency : 0x36

Conclusion

The I/O system defines the model of I/O processing on Windows and performs functions that are common to or required by more than one driver. Its chief responsibility is to create IRPs representing I/O requests and to shepherd the packets through various drivers, returning results to the caller when an I/O is complete. The I/O manager locates various drivers and devices by using I/O system objects, including driver and device objects. Internally, the Windows I/O system operates asynchronously to achieve high performance and provides both synchronous and asynchronous I/O capabilities to user-mode applications.

Device drivers include not only traditional hardware device drivers but also file system, network, and layered filter drivers. All drivers have a common structure and communicate with one another and the I/O manager by using common mechanisms. The I/O system interfaces allow drivers to be written in a high-level language to lessen development time and to enhance their portability. Because drivers present a common structure to the operating system, they can be layered one on top of another to achieve modularity and reduce duplication between drivers. Also, all Windows device drivers should be designed to work correctly on multiprocessor systems.

Finally, the role of the PnP manager is to work with device drivers to dynamically detect hardware devices and to build an internal device tree that guides hardware device enumeration and driver installation. The power manager works with device drivers to move devices into low-power states when applicable to conserve energy and prolong battery life.

Перейти на страницу:

Похожие книги