Robert Love: Those Dang DPCs Clogging the MMCSS
Vista’s funky networking performance amid multimedia playback elicited a reply from Microsoft’s own Mark Russinovich:
Besides activity by other threads, media playback can also be affected by network activity. When a network packet arrives at [the] system, it triggers a CPU interrupt, which causes the device driver for the device at which the packet arrived to execute an Interrupt Service Routine (ISR). Other device interrupts are blocked while ISRs run, so ISRs typically do some device book-keeping and then perform the more lengthy transfer of data to or from their device in a Deferred Procedure Call (DPC) that runs with device interrupts enabled. While DPCs execute with interrupts enabled, they take precedence over all thread execution, regardless of priority, on the processor on which they run, and can therefore impede media playback threads.
Network DPC receive processing is among the most expensive, because it includes handing packets to the TCP/IP driver, which can result in lengthy computation. The TCP/IP driver verifies each packet, determines the packetâ€™s protocol, updates the connection state, finds the receiving application, and copies the received data into the applicationâ€™s buffers.
Mark goes on to show that copying a file from one machine to another consumes a staggering 41% of the available processor. In Joey’s words, that is horrid and just an awful situation.