- Creating an Interrupt Object
- Supporting Message-signaled Interrupts
- Почему на компьютере запущен процесс System Interrupts – как отключить
- Что такое процесс System Interrupts
- Почему System interrupts использует много ресурсов
- Можно ли отключить System interrupts
- Может ли System interrupts быть вирусом
- Introduction to Interrupt Service Routines
- Using Interrupt Resource Descriptors
Creating an Interrupt Object
A Windows Driver Frameworks (WDF) driver that handles a device’s hardware interrupts must create a framework interrupt object for each interrupt that each device can support. In framework versions 1.11 and later running on WindowsВ 8 or later versions of the operating system, Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF) drivers can create interrupt objects requiring passive-level handling. Unless you are writing a driver for a System on a Chip (SoC) platform, however, your driver should use DIRQL interrupt objects.
A driver typically creates framework interrupt objects in its EvtDriverDeviceAdd callback function. A driver can also create interrupt objects from its EvtDevicePrepareHardware callback function.
The framework calls the driver’s EvtDriverDeviceAdd callback function before the Plug and Play (PnP) manager has assigned system resources, such as interrupt vectors, to the device. After the PnP manager assigns resources, the framework stores interrupt resources in the device’s interrupt object. (Drivers that do not support Plug and Play cannot use interrupt objects.)
To create a framework interrupt object, your driver must initialize a WDF_INTERRUPT_CONFIG structure and pass it to the WdfInterruptCreate method.
UMDF supports the following types of interrupts:
- Level-triggered (shared or exclusive)
- Edge-triggered (exclusive only)
- MSI (exclusive by definition)
NoteВ В UMDF does not support shared edge-triggered interrupts.
Starting in UMDF version 2.15, UMDF supports interrupts for simple devices like hardware push-buttons, usually backed by GPIO pins, that you cannot enable or disable explicitly using hardware registers. To support such devices, a UMDF driver must use exclusive edge-triggered interrupts.
Starting in KMDF version 1.15, KMDF also supports interrupts for such devices, without the workaround described in Handling Active-Both Interrupts.
Also in WDF_INTERRUPT_CONFIG, your driver supplies pointers to the following driver-supplied event callback functions:
EvtInterruptIsr
Interrupt service routine (ISR) for the interrupt.
EvtInterruptDpc
Deferred procedure call (DPC) for the interrupt.
For drivers using framework version 1.11 or later on WindowsВ 8 or later versions of the operating system, the driver can explicitly set the parent of a framework interrupt object (DIRQL or passive) to either a framework device object or a framework queue object. If the driver specifies a parent, the driver must set the AutomaticSerialization member of the interrupt object’s WDF_INTERRUPT_CONFIG structure to TRUE. (Recall that if AutomaticSerialization is TRUE, the framework synchronizes execution of the interrupt object’s EvtInterruptDpc or EvtInterruptWorkItem callback function with callback functions from other objects that are underneath the interrupt’s parent object.)
As an example, a driver might specify a queue as parent of an interrupt to synchronize the queue’s callbacks with either the interrupt’s EvtInterruptDpc or EvtInterruptWorkItem callback. In this configuration, the framework deletes the queue object when it deletes the device object.
After calling WdfInterruptCreate, the driver can optionally call WdfInterruptSetPolicy or WdfInterruptSetExtendedPolicy to specify additional interrupt parameters. Typically the driver calls these methods from its EvtDriverDeviceAdd callback function.
The framework automatically deletes the interrupt before deleting the interrupt’s parent. Optionally, a driver can call WdfObjectDelete to delete the interrupt at an earlier time.
Supporting Message-signaled Interrupts
Message-signaled interrupts (MSIs) are supported starting with Windows Vista. To enable the operating system to support MSIs for your device, your driver’s INF file must set some values in the registry. For information about how to set these values, see Enabling Message-Signaled Interrupts in the Registry.
Your driver should create a framework interrupt object for each interrupt vector or MSI message that the device can support. If the PnP manager does not grant the device all of the interrupt resources that the device can support, the extra interrupt objects will not be used and their callback functions will not be called.
In WindowsВ 7, the operating system does not support resource requests for more than 910 interrupt messages per device function. In WindowsВ 8, the operating system does not support resource requests for more than 2048 interrupts per device function.
If the device driver exceeds this limit, the device might fail to start. To operate in a computer that contains many logical processors, the driver should not request more than one interrupt per processor.
A driver must tolerate, without failures, system rebalancing of interrupt resources in which the PnP manager assigns to the device any set of alternative interrupt resources from the resource requirements list. For example, the device might be assigned a smaller number of message interrupts than the driver requested. In the worst case, the driver must be prepared to operate the device with just one line-based interrupt.
Почему на компьютере запущен процесс System Interrupts – как отключить
Если вы когда-либо заходили в диспетчер задач, вероятно, замечали процесс под названием «System Interrupts». Если Вам интересно, зачем он использует ваш процессор, то мы готовы дать Вам ответ.
Что такое процесс System Interrupts
System Interrupts является официальной частью Windows, и, хотя он отображается в списке процессов Диспетчера задач, это не совсем процесс в традиционном смысле. Скорее, это заполнитель, используемый для отображения системных ресурсов, используемых всеми аппаратными прерываниями, происходящими на вашем ПК.
Хотя «аппаратное прерывание» звучит грубо – это стандартная система связи между вашим оборудованием (и сопряженным программным обеспечением) и вашим процессором.
Скажем, вы начинаете печатать что-то на клавиатуре. Вместо того, чтобы отдавать целый процесс на отслеживание сигналов от клавиатуры, материнская плата, которая обрабатывает такого рода сигналы, действует по-другому. Когда она «замечает» что другое устройство нуждается во внимании процессора, то передает сигнал прерывания к процессору. Если это прерывание с высоким приоритетом (как это обычно бывает с пользовательским вводом), процессор приостанавливает любой другой процесс, над которым работает, обрабатывает прерывание, а затем возобновляет свой предыдущий процесс.
Всё это происходит молниеносно. Но, Вы даже можете увидеть этот процесс в действии. Запустите Диспетчер задач и прокрутите вниз, пока не увидите «System Interrupts». Теперь откройте блокнот и начните печатать. Вы увидите всплески потребления ресурсов процессора, как правило, на десятую часть процентного пункта или около того.
Во время обычных операций вы можете увидеть, что использование ЦП «System interrupts» ненадолго поднимается до 10%.
Почему System interrupts использует много ресурсов
Если вы видите, что System interrupts использует процессор более чем на 20% и – это главное – остаётся на таком уровне постоянно, то у вас проблемы. Так как стабильно высокая загрузка центрального процессора означает, что часть оборудования или связанный с ним драйвер «плохо себя ведёт».
Как устранить проблему с оборудованием? Это и есть сложная часть.
Первым шагом должна быть перезагрузка компьютера. Мы знаем, что вы слышали это миллион раз, но этот совет всё ещё самый актуальный. Перезапуск компьютер может исправить большинство проблем с работой оборудования, и это достаточно легкий шаг, чтобы его выполнить.
Если перезагрузка компьютера не устранит проблему использования ЦП, следующий шаг – проверить актуальность установленных обновлений на компьютере. Пусть Центр обновления Windows сделает своё дело, так Вы будете уверены, что получили все последние обновления Windows и драйверов (по крайней мере, драйверов, которыми управляет Windows).
Если обновление драйверов компьютера и оборудования не принесло результата, то нужно найти какое именно оборудование вызывает проблемы. Диагностика всего вашего оборудования выходит за рамки этой статьи, но мы дадим некоторые полезные рекомендации, чтобы помочь вам сузить круг поиска.
Начните с отключения внешних устройств по одному, таких как клавиатура, мышь, веб-камера и микрофон. Просто отключите их по одному и посмотреть, как это влияет на работу System interrupts.
Затем перейдите к внутренним устройствам. Очевидно, это немного сложнее, так как не всегда их можно просто отключить. Но вы можете отключить их через диспетчер устройств. Однако, нужно быть осторожными, чтобы не отключить устройства, критически важные для поддержания работы вашей системы, такие как жесткие диски или адаптеры дисплея. Кроме того, не отключайте ничего из перечисленного в категориях компьютер, процессоры или системные устройства. Сосредоточьтесь на сетевых адаптерах, звуковых картах и других дополнительных картах. Они является наиболее вероятными виновниками проблем.
Неотключаемое оборудование также может вызывать проблемы, но можно проверить другим путём. Сбой питания (или проблемы батареи ноутбука) может вызвать всплеск использования центрального процессора, как и отказ жесткого диска. Вы можете проверить свои жесткие диски встроенным инструментом Windows или хорошей сторонней S.M.A.R.T. утилитой. К сожалению, единственный способ проверить источник питания – заменить его.
Если вы определили устройство, которое вызывает проблемы, следующий шаг – выяснить, вызывает ли проблему само устройство или драйвер оборудования.
Опять же, это немного сложно понять и потребует некоторых проб и ошибок, но у нас есть некоторые рекомендации:
- Попробуйте использовать внешние устройства на другом компьютере.
- Если Вы абсолютно уверены в самом устройстве, то попробуйте откат драйвера к более ранней версии.
- Воспользуйтесь поиском или зайдите на веб-сайт производителя оборудования и посмотрите, имеют ли другие люди имеют аналогичные проблемы.
- Рассмотрите возможность обновление BIOS – это иногда помогает решить проблему.
Можно ли отключить System interrupts
Нет, System interrupts отключать нельзя. И тому нет никаких веских причин. Это жизненно важный компонент для производительности вашего компьютера, так как он используется для обработки аппаратных прерываний. Windows не позволит даже временно завершить задачу.
Может ли System interrupts быть вирусом
System interrupts является официальным компонентом Windows. Это почти наверняка не вирус. Поскольку это даже не процесс, System interrupts не имеет связанного .EXE или .DLL файла.
Тем не менее, возможно, что вирус вмешивается в конкретный драйвер оборудования, который, в свою очередь, может повлиять на System interrupts.
Introduction to Interrupt Service Routines
A driver of a physical device that receives interrupts registers one or more interrupt service routines (ISR) to service the interrupts. The system calls the ISR each time it receives that interrupt.
Devices for ports and buses prior to PCIВ 2.2 generate line-based interrupts. A device generates the interrupt by sending an electrical signal on a dedicated pin known as an interrupt line. Versions of Microsoft Windows prior to WindowsВ Vista only support line-based interrupts.
Beginning with PCIВ 2.2, PCI devices can generate message-signaled interrupts. A device generates a message-signaled interrupt by writing a data value to a particular address. WindowsВ Vista and later operating systems support both line-based and message-signaled interrupts.
The system supports two different types of ISRs:
The driver can register an InterruptService routine to handle line-based or message-signaled interrupts. (This is the only type available prior to WindowsВ Vista.) The system passes a driver-supplied context value.
The driver can register an InterruptMessageService routine to handle message-signaled interrupts. The system passes both a driver-supplied context value and the messageВ ID of the interrupt message.
For more information about registering an InterruptService or InterruptMessageService routine to service the device’s interrupts, see Introduction to Message-Signaled Interrupts.
Using Interrupt Resource Descriptors
The Plug and Play (PnP) manager assigns interrupt messages to a device using two passes. First, the PnP manager sends an IRP_MN_FILTER_RESOURCE_REQUIREMENTS request to the driver with a list of hardware resources, including interrupt messages, that it intends to assign to the device. The driver can modify this list to change the number of interrupt messages, as well as some per-message settings. Then, after the PnP manager actually assigns the resources, it sends an IRP_MN_START_DEVICE request and supplies a complete list of the hardware resources, including interrupt messages, assigned to the driver’s device.
The IRP_MN_FILTER_RESOURCE_REQUIREMENTS request supplies a list of IO_RESOURCE_DESCRIPTOR structures. If the device has an MSI (message-signaled interrupt) capability structure as defined in the PCI 2.2 specification, the PnP manager supplies a single interrupt message descriptor. If the device has an MSI-X capability structure as defined in the PCI 3.0 specification, the PnP manager supplies one structure for each interrupt message. Interrupt message descriptors have Type = CmResourceTypeInterrupt and Flags = CM_RESOURCE_INTERRUPT_LATCHED | CM_RESOURCE_INTERRUPT_MESSAGE. Drivers can also change settings such as the interrupt affinity by changing the u.Interrupt members of the structure. Note that when using MSI, interrupts all have same affinity, while when using MSI-X they can have different affinities. For more information, see Interrupt Affinity and Priority.
For MSI, as defined in PCI 2.2, u.Interrupt.MaximumVector — u.Interrupt.MinimumVector + 1 is the number of interrupt messages allocated for the device. Drivers can change the number of interrupt messages by modifying u.Interrupt.MinimumVector. For MSI interrupt messages, u.Interrupt.MaximumVector is always CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN. To allocate MessageCount interrupt messages, set u.Interrupt.MinimumVector to equal CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN — MessageCount + 1.
For MSI-X, as defined in PCI 3.0, drivers can change the number of interrupt messages allocated by adding or removing entries from the list. Note that interrupt message resources added this way must not be subsequently removed in response to the IRP_MN_START_DEVICE request. For MSI-X, the PnP manager supplies one descriptor per message interrupt, and the u.Interrupt.MinimumVector and u.Interrupt.MaximumVector members of this descriptor are both set to CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN.
Once the Plug and Play manager has assigned all hardware resources for the device, including interrupt messages, it sends the IRP_MN_START_DEVICE request to the driver. This request supplies two lists of CM_PARTIAL_RESOURCE_DESCRIPTOR structures, one each for raw and translated resources. For interrupt messages, the PnP manager supplies one structure for each allocated memory address with Type = CmResourceTypeInterrupt and Flags = CM_RESOURCE_INTERRUPT_LATCHED | CM_RESOURCE_INTERRUPT_MESSAGE.
Note that when using MSI, the driver only receives one interrupt resource descriptor, since all messages share the same address. The MessageCount member of u.MessageInterrupt.Raw can be used to determine the number of messages assigned. When using MSI-X, the driver receives a separate resource descriptor for each interrupt message.
In WindowsВ 8, the operating system does not support resource requests for more than 2048 interrupt messages per device function. In WindowsВ 7 and WindowsВ Vista, the operating system does not support resource requests for more than 910 interrupt messages per device function. If the device driver exceeds this limit, the device might fail to start. To enable a driver to operate in a computer that contains many logical processors, the driver should avoid requesting more than one interrupt per processor.
During system rebalancing of interrupt resources, the PnP manager might ask a driver to select a preferred set of alternate interrupt resources from a resource requirements list. However, the PnP manager cannot always assign to a driver the resources that the driver prefers. The driver must therefore tolerate, without failures, the assignment of any set of alternate interrupt resources from the resource requirements list. For example, the device might be assigned a smaller number of message interrupts than the driver requested. In the worst case, the driver must be prepared to operate the device with just one line-based interrupt.